@CHARSET "UTF-8";
:root {
    --erp-bg: #f4f6f8;
    --erp-surface: #ffffff;
    --erp-text: #17202a;
    --erp-muted: #727d88;
    --erp-border: #dfe4e8;
    --erp-dark: #202326;
    --erp-accent: #83c53a;
    --erp-danger: #bc3f3f;
    --erp-radius: 16px;
    --erp-shadow: 0 18px 48px rgba(20, 30, 42, .13);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    color: var(--erp-text);
    background: var(--erp-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
.erp-work-page { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
.erp-header {
    color: #fff;
    background: linear-gradient(145deg, #191b1d 0%, #2b2f32 100%);
    box-shadow: 0 8px 24px rgba(18, 23, 28, .16);
}
.erp-header-main {
    width: min(720px, calc(100% - 32px));
    margin-right: auto;
    margin-left: auto;
}
.erp-header-main { min-height: 64px; display: flex; align-items: center; }
.erp-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 8px; background: #fff; }
.erp-brand-copy { min-width: 0; margin-left: 12px; flex: 1; }
.erp-brand-copy strong { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.erp-username {
    margin-left: auto;
    max-width: 120px;
    overflow: hidden;
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.erp-logout {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin-left: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    justify-content: center;
    color: rgba(255, 255, 255, .84);
    border-radius: 10px;
    text-decoration: none;
    background: rgba(255, 255, 255, .08);
}
.erp-logout .erp-logout-label { display: none; }
.erp-logout:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.inventory-work-page { color: var(--erp-text); background: #f3f5f6; }
.inventory-topbar { min-height: 70px; padding: 0 max(18px, calc((100% - 720px) / 2)); display: flex; align-items: center; color: #fff; background: #202326; box-shadow: 0 5px 18px rgba(20, 25, 29, .14); }
.inventory-topbar > div { flex: 1; min-width: 0; margin-left: 12px; }
.inventory-topbar strong, .inventory-topbar span { display: block; }
.inventory-topbar strong { font-size: 17px; }
.inventory-topbar > .erp-username { margin-left: 16px; flex-shrink: 0; }
.inventory-topbar div span { margin-top: 3px; color: rgba(255,255,255,.56); font-size: 13px; }
.inventory-back { width: 44px; height: 44px; display: grid; place-items: center; color: #fff; border-radius: 11px; background: rgba(255,255,255,.09); font-size: 28px; text-decoration: none; }
.inventory-workspace { width: min(720px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0; }
.inventory-progress { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; color: #8a949c; font-size: 14px; }
.inventory-progress span { display: flex; align-items: center; gap: 6px; }
.inventory-progress b { width: 25px; height: 25px; display: grid; place-items: center; color: #75808a; border-radius: 50%; background: #e2e6e8; }
.inventory-progress i { flex: 1; height: 1px; margin: 0 10px; background: #d9dee1; }
.inventory-progress .is-active { color: #33411f; font-weight: 700; }
.inventory-progress .is-active b { color: #fff; background: #729e42; }
.inventory-progress .is-complete b { color: #fff; background: #a7c685; }
.inventory-progress .is-complete { color: #66755b; }
.erp-work-page .is-hidden { display: none; }
.inventory-panel, .inventory-context-panel { margin-bottom: 14px; padding: 22px; border: 1px solid var(--erp-border); border-radius: 16px; background: #fff; box-shadow: 0 5px 17px rgba(22,31,40,.05); }
.inventory-panel-heading { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.inventory-kicker { display: block; margin-bottom: 5px; color: #71804e; font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.inventory-panel h1, .inventory-panel h2 { margin: 0; font-size: 20px; line-height: 1.35; }
.inventory-state-badge { flex: 0 0 auto; white-space: nowrap; padding: 6px 9px; color: #5b672f; border-radius: 7px; background: #eef3e8; font-size: 12px; font-weight: 800; }
.inventory-scan-field, .inventory-search-field { position: relative; display: flex; align-items: center; }
.inventory-scan-field > i, .inventory-search-field > i { position: absolute; left: 16px; color: #7f8a94; font-size: 18px; }
.inventory-scan-input, .inventory-search-field input { width: 100%; min-height: 56px; padding: 0 112px 0 48px; color: #182027; border: 2px solid #cad1d5; border-radius: 12px; outline: 0; background: #fbfcfc; font-family: inherit; font-size: 18px; font-weight: 700; }
.inventory-search-field input { min-height: 56px; padding-right: 16px; font-size: 15px; font-weight: 500; }
.inventory-search-field input::-webkit-search-cancel-button { width: 44px; height: 44px; cursor: pointer; }
.inventory-scan-input:focus, .inventory-search-field input:focus { border-color: #7aa544; box-shadow: 0 0 0 4px rgba(122,165,68,.13); background: #fff; }
.inventory-scan-field > button { position: absolute; right: 6px; min-width: 88px; height: 44px; color: #fff; border: 0; border-radius: 9px; background: #25292c; font-weight: 700; cursor: pointer; }
.inventory-scan-edit-hint { margin-top: 8px; display: none; align-items: center; gap: 6px; color: #7f8992; font-size: 12px; line-height: 1.4; }
.inventory-scan-edit-hint.is-scan-device-visible { display: flex; justify-content: center; }
.inventory-scan-input.is-manual-input { box-shadow: inset 0 0 0 2px #91ad65; }
.inventory-help, .inventory-score-note { display: block; margin: 10px 0 0; color: #7f8992; font-size: 12px; line-height: 1.6; }
.inventory-search-results { max-height: 310px; margin-top: 10px; overflow-y: auto; border-radius: 10px; }
.inventory-result-item { width: 100%; min-height: 72px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; color: #293139; border: 1px solid #e0e4e6; border-bottom: 0; background: #fff; text-align: left; cursor: pointer; }
.inventory-result-item:first-child { border-radius: 10px 10px 0 0; }
.inventory-result-item:last-child { border-bottom: 1px solid #e0e4e6; border-radius: 0 0 10px 10px; }
.inventory-result-item:only-child { border-radius: 10px; }
.inventory-result-item.is-selected { border-color: #82a957; background: #f0f5eb; }
.inventory-result-item strong { font-size: 14px; line-height: 1.4; }
.inventory-result-item small { margin-top: 3px; color: #8a949c; font-size: 12px; }
.inventory-result-thumb { width: 54px; height: 54px; flex: 0 0 54px; overflow: hidden; border-radius: 8px; background: #eef1f2; }
.inventory-result-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.inventory-result-thumb.is-empty:after { content: "\f03e"; height: 100%; display: flex; align-items: center; justify-content: center; color: #a5adb3; font-family: FontAwesome; font-size: 18px; }
.inventory-result-copy { min-width: 0; display: flex; flex-direction: column; }
.inventory-result-subtitle { margin-top: 2px; max-height: 2.7em; overflow: hidden; display: -webkit-box; color: #758089; font-size: 12px; font-weight: 500; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.inventory-quantity-stepper { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid #bcc7b4; border-radius: 9px; background: #fff; }
.inventory-quantity-stepper button { width: 44px; height: 44px; flex: 0 0 44px; padding: 0; color: #49652c; border: 0; background: #f3f7ef; font-size: 24px; font-weight: 700; line-height: 1; cursor: pointer; }
.inventory-quantity-stepper button:hover { background: #e8f0df; }
.inventory-quantity-stepper input { height: 44px; border: 0; border-right: 1px solid #d5ddce; border-left: 1px solid #d5ddce; border-radius: 0; outline: 0; text-align: center; -moz-appearance: textfield; }
.inventory-quantity-value { width: 76px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: #30383e; border-right: 1px solid #d5ddce; border-left: 1px solid #d5ddce; font-size: 18px; font-weight: 800; line-height: 1; }
.inventory-quantity-stepper input::-webkit-inner-spin-button, .inventory-quantity-stepper input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.erp-work-page .select2-selection__clear { position: relative; float: right; min-width: 44px; height: 46px; margin: 0; margin-right: 0; margin-left: 8px; padding-right: 2px; display: flex; align-items: center; justify-content: flex-end; transform: translateY(-1px); box-sizing: border-box; color: #66727b; font-size: 22px; line-height: 1; }
.erp-work-page .select2-container--default .select2-selection--single .select2-selection__arrow b { margin-left: -6px; margin-top: -3px; border-color: #66727b transparent transparent transparent; border-width: 7px 6px 0 6px; }
.erp-work-page .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { margin-top: -4px; border-color: transparent transparent #66727b transparent; border-width: 0 6px 7px 6px; }
.erp-work-page .select2-selection--single:hover .select2-selection__clear { color: #3f4a52; }
.erp-work-page .select2-container--default .select2-selection--single:hover .select2-selection__arrow b { border-color: #3f4a52 transparent transparent transparent; }
.erp-work-page .select2-container--default.select2-container--open .select2-selection--single:hover .select2-selection__arrow b { border-color: transparent transparent #3f4a52 transparent; }
.inventory-primary-button, .inventory-secondary-button { min-height: 52px; padding: 0 18px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 11px; font-size: 15px; font-weight: 800; text-decoration: none; cursor: pointer; }
.inventory-primary-button { width: 100%; margin-top: 14px; color: #fff; background: #202326; }
.inventory-primary-button:disabled { cursor: not-allowed; opacity: .4; }
.inventory-secondary-button { color: #46515a; border: 1px solid #d3d9dd; background: #fff; }
.inventory-compact-button,
.order-scan-card-heading .inventory-primary-button,.order-scan-card-heading .inventory-secondary-button { width: auto; min-height: 44px; margin-top: 0; padding: 0 14px; flex: 0 0 auto; font-size: 13px; }
.inventory-button-row { margin-top: 14px; display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.inventory-button-row .inventory-primary-button { margin-top: 0; }
.inventory-feedback { position: fixed; right: 18px; bottom: 18px; left: 18px; z-index: 10; max-width: 688px; min-height: 48px; margin: auto; padding: 13px 16px; display: none; align-items: center; border-radius: 11px; box-shadow: 0 8px 28px rgba(23,30,35,.18); font-size: 13px; font-weight: 700; }
.inventory-feedback.is-visible { display: flex; }
.inventory-modal .inventory-feedback { position: static; max-width: none; margin: 14px 0 0; box-shadow: none; }
.inventory-feedback.is-success { color: #31521e; background: #e7f2de; }
.inventory-feedback.is-error { color: #7b2f2f; background: #f7e5e5; }
.inventory-feedback.is-info { color: #31526c; background: #e4eff6; }
.inventory-modal { position: fixed; inset: 0; z-index: 30; padding: 20px; display: flex; align-items: center; justify-content: center; background: rgba(18, 22, 25, .58); }
.erp-work-page.modal-open { overflow: hidden; }
.erp-work-page .modal { position: fixed; inset: 0; z-index: 1050; display: none; overflow: hidden; outline: 0; }
.erp-work-page.modal-open .modal { overflow-x: hidden; overflow-y: auto; }
.erp-work-page .modal-dialog { position: relative; width: min(420px, calc(100% - 40px)); margin: 20px auto; }
.erp-work-page .modal.fade { opacity: 0; transition: opacity .15s linear; }
.erp-work-page .modal.fade.in { opacity: 1; }
.erp-work-page .modal-backdrop { position: fixed; inset: 0; z-index: 1040; background: #121619; opacity: .58; }
.erp-work-page .modal-backdrop.fade { opacity: 0; transition: opacity .15s linear; }
.erp-work-page .modal-backdrop.fade.in { opacity: .58; }
.erp-work-page .modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; }
.inventory-modal-card { width: min(420px, 100%); padding: 24px; border-radius: 16px; background: #fff; box-shadow: 0 18px 50px rgba(15, 20, 24, .24); }
.inventory-modal-card h2 { margin: 0; font-size: 21px; }
.inventory-modal-card p { margin: 12px 0 0; color: #69747d; font-size: 13px; line-height: 1.65; }
.inventory-modal-card p strong { color: #252c31; overflow-wrap: anywhere; }
.inventory-modal-card .inventory-button-row { margin-top: 20px; }
.inventory-empty { margin: 12px 0; color: #7e8891; font-size: 13px; }
.inventory-context-panel { display: grid; grid-template-columns: repeat(3, 1fr) auto; align-items: center; gap: 16px; }
.inventory-context-panel span { display: block; color: #89939b; font-size: 12px; }
.inventory-context-panel strong { display: block; margin-top: 5px; font-size: 14px; }
.inventory-context-panel small { display: block; margin-top: 4px; color: #7f8992; font-size: 12px; overflow-wrap: anywhere; }
.inventory-link-button { min-height: 44px; padding: 0 12px; color: #42542e; border: 1px solid #cbd7bf; border-radius: 9px; background: #f1f5ed; font-size: 13px; font-weight: 700; cursor: pointer; }
.inventory-link-button:disabled { opacity: .4; }
.inventory-product-summary { padding: 15px; border-radius: 11px; background: #f3f5f5; }
.inventory-product-summary strong, .inventory-product-summary small { display: block; }
.inventory-product-summary small { margin-top: 5px; color: #7d8790; }
.inventory-confirm-modal { position: fixed; inset: 0; z-index: 50; padding: 18px; display: flex; align-items: center; justify-content: center; }
.inventory-confirm-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(18,22,25,.58); cursor: pointer; }
.inventory-confirm-card { position: relative; z-index: 1; width: min(420px, 100%); padding: 26px 24px 22px; border: 1px solid rgba(255,255,255,.55); border-radius: 18px; background: #fff; box-shadow: 0 20px 55px rgba(15,20,24,.28); text-align: center; }
.inventory-confirm-icon { width: 46px; height: 46px; margin: 0 auto 13px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: #729e42; box-shadow: 0 7px 18px rgba(114,158,66,.28); font-size: 18px; }
.inventory-confirm-card h2 { margin: 0; color: #20282e; font-size: 20px; }
.inventory-confirm-card p { margin: 10px 0 0; color: #65717a; font-size: 14px; line-height: 1.65; }
.inventory-confirm-card .inventory-button-row { margin-top: 22px; }
@media (min-width: 900px) {
    .erp-header-main { width: min(1040px, calc(100% - 48px)); }
    .inventory-topbar { padding-right: max(24px, calc((100% - 1040px) / 2)); padding-left: max(24px, calc((100% - 1040px) / 2)); }
    .inventory-workspace { width: min(1040px, calc(100% - 48px)); padding-top: 30px; }
    .inventory-confirm-modal { align-items: center; }
    .inventory-confirm-card { width: min(460px, 100%); padding: 30px; }
    .inventory-search-results { max-height: 390px; }
}
@media (max-width: 480px) {
    .erp-header-main { width: calc(100% - 24px); }
    .erp-username { max-width: 68px; }
    .erp-logout { margin-left: 8px; }
}
@media (max-width: 600px) {
    .inventory-topbar { min-height: 62px; padding: 0 12px; }
    .inventory-topbar div span { display: none; }
    .inventory-workspace { width: calc(100% - 20px); padding-top: 14px; }
    .inventory-progress { overflow: hidden; }
    .inventory-progress span { gap: 4px; font-size: 12px; }
    .inventory-progress b { width: 23px; height: 23px; font-size: 12px; }
    .inventory-progress i { margin: 0 6px; }
    .inventory-panel, .inventory-context-panel { padding: 16px; border-radius: 13px; }
    .inventory-panel h1, .inventory-panel h2 { font-size: 18px; }
    .inventory-context-panel { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
    .inventory-context-panel > div:last-of-type,
        .inventory-link-button { grid-column: auto; }
    .inventory-scan-input { padding-right: 98px; font-size: 16px; }
    .inventory-scan-field > button { min-width: 76px; }
    .inventory-button-row { grid-template-columns: 1fr 1.4fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *:before, *:after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
[data-erp-image-preview] img { cursor: pointer; }

@media (max-width: 480px) {
    .erp-brand-copy strong { font-size: 14px; }
}

/* Shared inventory unpack dialog (outbound and adjustment). */
.outbound-unpack { color: var(--erp-text); font-size: 13px; line-height: 1.6; }
.outbound-unpack-info, .outbound-unpack-quantity, .outbound-unpack-physical { color: inherit; }
.outbound-unpack > p, .outbound-unpack p strong { color: inherit; }
.outbound-unpack-info { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 6px 8px; margin: 0; padding-bottom: 14px; border-bottom: 1px solid var(--erp-border); }
.outbound-unpack-info dt, .outbound-unpack-info dd { margin: 0; font-weight: 400; }
.outbound-unpack-info dd { overflow-wrap: anywhere; font-weight: 700; }
.outbound-unpack-quantity { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-weight: 400; }
.outbound-unpack-quantity > span:first-child { flex: 0 0 56px; }
.outbound-unpack-input { display: flex; align-items: center; gap: 8px; min-width: 0; }
.outbound-unpack input[type=number] { box-sizing: border-box; width: 88px; max-width: 100%; height: 40px; padding: 0 10px; border: 1px solid #cad1d5; border-radius: 9px; color: inherit; font-size: 14px; }
.outbound-unpack .outbound-unpack-note { margin-top: 8px; color: var(--erp-muted); font-size: 12px; }
.outbound-unpack-physical { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; font-size: 13px; cursor: pointer; }
.outbound-unpack-physical input { width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 auto; accent-color: #729e42; }
.outbound-unpack .outbound-error { color: var(--erp-danger); }
.outbound-unpack [data-error]:empty { display: none; }
