/* WMS button appearance, 2026-11-02.
 * Loaded after page styles so shared, document and standalone pages use one
 * visual hierarchy. Screen-only: printed documents retain their own rules.
 * Existing pages use !important for button geometry; only appearance is
 * overridden here. Visibility, widths, disabled behavior and events stay local.
 */
@media screen {
    :root {
        --wms-button-primary: #2563eb;
        --wms-button-primary-hover: #1d4ed8;
        --wms-button-border: #d7dde5;
        --wms-button-text: #334155;
        --wms-button-radius: 6px;
    }

    body .btn,
    body .btn-order,
    body .tool-btn,
    body .wms-entry-toolbar .btn,
    body .doc-toolbar .btn,
    body .tplus-toolbar .btn,
    body .adjust-toolbar .btn,
    body .footer-bar .btn,
    body .btn-login,
    body .h5-link,
    body #printPreviewButton {
        min-height: 34px;
        border: 1px solid var(--wms-button-border) !important;
        border-radius: var(--wms-button-radius) !important;
        padding: 6px 12px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 20px !important;
        gap: 6px !important;
        color: var(--wms-button-text) !important;
        background-color: #fff !important;
        background-image: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
        transform: none !important;
        transition: background-color .15s ease, border-color .15s ease, color .15s ease !important;
    }

    body .btn::after,
    body .btn-order::after {
        content: none !important;
    }

    body .btn:hover,
    body .btn-order:hover,
    body .tool-btn:hover {
        color: #0f172a !important;
        background-color: #f8fafc !important;
        border-color: #94a3b8 !important;
        box-shadow: none !important;
        transform: none !important;
    }

    body .btn.btn-primary,
    body .btn-order.btn-order-primary,
    body .cb-actionbar [data-wms-action="save"],
    body .cb-actionbar [data-wms-action="add"],
    body .tool-btn[data-wms-save],
    body .tool-btn[data-action="save"],
    body .btn-login,
    body .h5-link,
    body #printPreviewButton {
        color: #fff !important;
        background-color: var(--wms-button-primary) !important;
        border-color: var(--wms-button-primary) !important;
    }

    body .btn.btn-primary:hover,
    body .btn-order.btn-order-primary:hover,
    body .cb-actionbar [data-wms-action="save"]:hover,
    body .cb-actionbar [data-wms-action="add"]:hover,
    body .tool-btn[data-wms-save]:hover,
    body .tool-btn[data-action="save"]:hover,
    body .btn-login:hover,
    body .h5-link:hover,
    body #printPreviewButton:hover {
        color: #fff !important;
        background-color: var(--wms-button-primary-hover) !important;
        border-color: var(--wms-button-primary-hover) !important;
    }

    /* A form's Save is primary; New remains available as a secondary action. */
    body .cb-actionbar:has([data-wms-action="save"]) [data-wms-action="add"] {
        color: var(--wms-button-text) !important;
        background-color: #fff !important;
        border-color: var(--wms-button-border) !important;
    }

    /* Use spacing, rather than vertical rules, to separate toolbar actions. */
    body .cb-actionbar {
        gap: 8px;
    }

    body .page-header .btn {
        padding: 6px 10px !important;
    }

    body .cb-actionbar .cb-actionbar-divider,
    body .cb-actionbar .vr,
    body .page-header .vr,
    body .wms-entry-toolbar .vr,
    body .doc-toolbar .vr,
    body .tplus-toolbar .vr {
        display: none !important;
    }

    body .btn.btn-link {
        color: var(--wms-button-primary) !important;
        background-color: transparent !important;
        border-color: transparent !important;
    }

    /* Dense row actions remain directly visible without a row of solid fills. */
    body .table tbody .btn,
    body .table tbody .btn-order,
    body .doc-grid tbody .btn,
    body .wms-entry-grid tbody .btn {
        min-width: 28px;
        min-height: 28px;
        height: 28px;
        padding: 4px 7px !important;
        font-size: 12px !important;
        line-height: 18px !important;
        border-radius: 5px !important;
        gap: 4px !important;
    }

    body .table tbody .btn.btn-primary,
    body .table tbody .btn-order.btn-order-primary {
        color: var(--wms-button-text) !important;
        background-color: #fff !important;
        border-color: var(--wms-button-border) !important;
    }

    body .table tbody .btn + .btn,
    body .table tbody .btn-order + .btn-order {
        margin-left: 3px;
    }

    /* Formatting toggles must continue to show the current selection. */
    body .btn.active,
    body .btn[aria-pressed="true"],
    body .btn-order.active,
    body .tool-btn.active {
        color: #1d4ed8 !important;
        background-color: #eff6ff !important;
        border-color: #93c5fd !important;
    }

    body .btn i,
    body .btn-order i,
    body .tool-btn i {
        display: inline-block;
        width: 16px;
        height: 16px;
        margin: 0 !important;
        font-size: 16px !important;
        line-height: 16px;
        vertical-align: middle;
        text-align: center;
        flex-shrink: 0;
    }

    body .table tbody .btn i,
    body .table tbody .btn-order i,
    body .wms-entry-grid tbody .btn i {
        width: 14px;
        height: 14px;
        font-size: 14px !important;
        line-height: 14px;
    }

    /* One 1.75px round-stroke icon family; retain existing DOM icon classes. */
    body .btn .bi-plus-lg { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%205v14M5%2012h14%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-download { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2016v3a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2v-3M7%2010l5%205%205-5M12%2015V3%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-file-earmark-spreadsheet { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%203H6a2%202%200%200%200-2%202v14a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V9zM14%203v6h6M8%2013h8M8%2017h8M12%2013v4%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-share { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2218%22%20cy%3D%225%22%20r%3D%223%22%2F%3E%3Ccircle%20cx%3D%226%22%20cy%3D%2212%22%20r%3D%223%22%2F%3E%3Ccircle%20cx%3D%2218%22%20cy%3D%2219%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22m8.6%2010.5%206.8-4m-6.8%207%206.8%204%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-cloud-upload { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M7%2018H6a4%204%200%201%201%20.5-8%206%206%200%200%201%2011.6-1.6A4.5%204.5%200%200%201%2018%2018h-1M12%2021V11m-4%204%204-4%204%204%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-pencil { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m16%203%205%205M4%2015l12-12a2.1%202.1%200%200%201%203%200l2%202a2.1%202.1%200%200%201%200%203L9%2020l-6%201z%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-files { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%228%22%20y%3D%228%22%20width%3D%2213%22%20height%3D%2213%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M16%208V5a2%202%200%200%200-2-2H5a2%202%200%200%200-2%202v9a2%202%200%200%200%202%202h3%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-printer { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%209V3h12v6M6%2018H4a2%202%200%200%201-2-2v-5a2%202%200%200%201%202-2h16a2%202%200%200%201%202%202v5a2%202%200%200%201-2%202h-2M6%2014h12v7H6zM17%2012h1%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-send { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m22%202-7%2020-4-9-9-4zM22%202%2011%2013%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-image { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Ccircle%20cx%3D%228%22%20cy%3D%228%22%20r%3D%221.5%22%2F%3E%3Cpath%20d%3D%22m21%2015-5-5L5%2021%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-trash { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%206h18M9%206V4a1%201%200%200%201%201-1h4a1%201%200%200%201%201%201v2M5%206l1%2014a1%201%200%200%200%201%201h10a1%201%200%200%200%201-1l1-14M10%2010v7M14%2010v7%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-arrow-left-right { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%207h17m-4-4%204%204-4%204M21%2017H4m4-4-4%204%204%204%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-layout-three-columns { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2216%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M9%204v16M15%204v16%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-arrow-repeat { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%207a8%208%200%200%200-13-3L3%208m0-5v5h5M4%2017a8%208%200%200%200%2013%203l4-4m0%205v-5h-5%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-grid-3x3 { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-search { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2210.5%22%20cy%3D%2210.5%22%20r%3D%227.5%22%2F%3E%3Cpath%20d%3D%22m16%2016%205%205%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-exclamation-triangle { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M10.3%203.9%201.8%2018.5A2%202%200%200%200%203.5%2021h17a2%202%200%200%200%201.7-2.5L13.7%203.9a2%202%200%200%200-3.4%200zM12%209v4M12%2017h.01%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-arrow-counterclockwise { --wms-button-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2010a9%209%200%201%201%202.6%208.4M3%204v6h6%22%2F%3E%3C%2Fsvg%3E"); }
    body .btn .bi-exclamation-triangle::before,
    body .btn .bi-arrow-counterclockwise::before,
    body .btn .bi-plus-lg::before,
    body .btn .bi-download::before,
    body .btn .bi-file-earmark-spreadsheet::before,
    body .btn .bi-share::before,
    body .btn .bi-cloud-upload::before,
    body .btn .bi-pencil::before,
    body .btn .bi-files::before,
    body .btn .bi-printer::before,
    body .btn .bi-send::before,
    body .btn .bi-image::before,
    body .btn .bi-trash::before,
    body .btn .bi-arrow-left-right::before,
    body .btn .bi-layout-three-columns::before,
    body .btn .bi-arrow-repeat::before,
    body .btn .bi-grid-3x3::before,
    body .btn .bi-search::before {
        content: "" !important;
        display: block;
        width: 100%;
        height: 100%;
        background: currentColor;
        -webkit-mask: var(--wms-button-icon) center / contain no-repeat;
        mask: var(--wms-button-icon) center / contain no-repeat;
    }

    body .cb-actionbar .btn i {
        margin-right: 0;
    }

    body .modal .modal-footer .btn,
    body .cb-confirm-actions .btn {
        min-height: 36px;
        height: auto;
        padding: 7px 14px !important;
    }

    /* Keep the final destructive confirmation visually explicit. */
    body .modal .modal-footer .btn.btn-danger {
        color: #fff !important;
        background-color: #b91c1c !important;
        border-color: #b91c1c !important;
    }

    body .btn-login,
    body .h5-link {
        min-height: 44px;
        padding: 10px 18px !important;
        font-size: 15px !important;
    }

    body .btn:focus-visible,
    body .btn-order:focus-visible,
    body .tool-btn:focus-visible,
    body .btn-login:focus-visible,
    body .h5-link:focus-visible,
    body #printPreviewButton:focus-visible {
        outline: 2px solid var(--wms-button-primary);
        outline-offset: 2px;
    }

    body .btn:disabled,
    body .btn.disabled,
    body .modal .modal-footer .btn:disabled,
    body .modal .modal-footer .btn.disabled,
    body .btn-order:disabled,
    body .btn-order.disabled,
    body .tool-btn:disabled,
    body .btn-login:disabled {
        color: #94a3b8 !important;
        background-color: #f1f5f9 !important;
        border-color: #e2e8f0 !important;
        opacity: 1 !important;
        box-shadow: none !important;
        transform: none !important;
    }

    @media (max-width: 768px) {
        /* Avoid nesting the action grid inside half of the heading grid. */
        body .page-header > .d-flex:has(> h2) {
            grid-template-columns: minmax(0, 1fr) !important;
            align-items: stretch !important;
        }

        body .page-header .vr {
            display: none;
        }

        body .btn,
        body .btn-order,
        body .tool-btn,
        body .cb-actionbar .btn,
        body .page-header .btn,
        body .wms-entry-toolbar .btn,
        body .modal .modal-footer .btn,
        body .mobile-scan-camera,
        body .mobile-scan-lookup,
        body .mobile-scan-submit {
            min-height: 44px !important;
            height: auto !important;
            font-size: 14px !important;
        }

        body .page-header .btn,
        body .wms-entry-toolbar .btn {
            padding: 6px 8px !important;
            white-space: normal !important;
            overflow-wrap: anywhere;
            gap: 4px !important;
        }

        body .table tbody .btn,
        body .table tbody .btn-order,
        body .wms-entry-grid tbody .btn {
            min-height: 36px !important;
            height: 36px !important;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        body .btn,
        body .btn-order,
        body .tool-btn,
        body .btn-login {
            transition: none !important;
        }
    }
}
