/* CRM common Bootstrap Table toolbar and scrollbar fix.
 * Scope: BootstrapTable surfaces only. Business toolbar actions remain untouched.
 */
.crm-table-ui-ready {
    overflow: visible !important;
}

.crm-table-ui-ready,
.crm-table-ui-ready .fixed-table-toolbar,
.crm-table-ui-ready .fixed-table-container,
.crm-table-ui-ready .fixed-table-body {
    max-width: 100%;
    box-sizing: border-box;
}

.crm-table-ui-ready .fixed-table-toolbar {
    position: relative;
    z-index: 30;
    overflow: visible !important;
}

.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools .btn,
.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools button {
    min-width: 32px;
    min-height: 32px;
    padding: 6px 9px;
    line-height: 18px;
    color: #334155 !important;
    background: #fff !important;
    border-color: #d7dde8 !important;
    border-radius: 6px;
    opacity: 1 !important;
    box-shadow: none !important;
}

.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools .btn:hover,
.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools button:hover {
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
    background: #f8fbff !important;
}

.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools .btn .fa,
.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools .btn .glyphicon,
.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools button .fa,
.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools button .glyphicon {
    color: inherit !important;
    opacity: 1 !important;
    font-size: 13px !important;
    line-height: 1 !important;
}

.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools .crm-table-tool-icon {
    display: inline-block !important;
    width: 14px;
    text-align: center;
    vertical-align: middle;
    visibility: visible !important;
}

.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools .caret {
    margin-left: 5px;
}

.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools,
.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools .keep-open,
.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools .export {
    position: relative;
    overflow: visible !important;
}

.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools .dropdown-menu {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    right: 0 !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 2060 !important;
    min-width: 180px;
    max-width: min(420px, 92vw);
    max-height: 60vh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
}

.crm-table-ui-ready .fixed-table-toolbar .crm-table-plugin-tools .crm-table-toolbar-dropup > .dropdown-menu {
    top: auto !important;
    bottom: calc(100% + 4px) !important;
}

.crm-table-ui-ready .fixed-table-body,
.crm-table-ui-ready .fixed-table-container {
    overflow-x: auto !important;
}

.crm-hidden-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.crm-hidden-scrollbar::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.crm-table-ui-ready .fixed-table-pagination {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    box-sizing: border-box;
}

.crm-table-ui-ready .fixed-table-pagination .pagination,
.crm-table-ui-ready .fixed-table-pagination .pagination-detail {
    white-space: nowrap;
}

/* ERP quote model table header overlap guard.
 * Keep row status backgrounds inside tbody cells and keep Bootstrap fixed header above the body layer.
 */
.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-container {
    position: relative;
}

.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-header {
    position: relative;
    z-index: 12;
    overflow: hidden !important;
    background: #f8fafc;
}

.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-header table,
.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-header thead,
.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-header tr,
.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-header th {
    background: #f8fafc !important;
}

.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-header th,
.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-header th .th-inner {
    position: relative;
    z-index: 13;
    box-sizing: border-box;
}

.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-body {
    position: relative;
    z-index: 1;
    margin-top: 0 !important;
    transform: none !important;
}

.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-body table {
    margin-top: 0 !important;
}

.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-body tbody > tr.erp-quote-row-unquoted > td,
.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-body tbody > tr.erp-quote-row-quoted-unread > td,
.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-body tbody > tr.erp-quote-row-quoted-read > td {
    position: relative;
    z-index: 1;
}

.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-header tbody,
.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-header tr.erp-quote-row-unquoted,
.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-header tr.erp-quote-row-quoted-unread,
.erp-quote-workbench .erp-quote-top-table-wrap .fixed-table-header tr.erp-quote-row-quoted-read {
    background: transparent !important;
}

/* Table detail links are text links. Real action buttons carry the .btn class. */
.bootstrap-table td a.btn-dialog:not(.btn),
#outstockcheck .approval-outstock-number-link,
#outstocksuccess .approval-outstock-number-link,
#purchasecheck .approval-purchase-number-link,
#purchasesuccess .approval-purchase-number-link,
/* Fallback for a stale controller response: the number cell remains the
 * outstock_num field even before the marker class is available. */
#outstockcheck td[data-table-preference-field="outstock_num"] > .btn-dialog,
#outstocksuccess td[data-table-preference-field="outstock_num"] > .btn-dialog,
#purchasecheck td[data-table-preference-field="num"] > .btn-dialog,
#purchasesuccess td[data-table-preference-field="num"] > .btn-dialog {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
    line-height: inherit !important;
    white-space: nowrap !important;
    color: inherit !important;
}

.bootstrap-table td a.btn-dialog:not(.btn):focus-visible {
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

/* The approval actions must have their own room so they cannot overlap the date column. */
#outstockcheck th[data-field="operate"],
#outstockcheck td[data-field="operate"],
#outstocksuccess th[data-field="operate"],
#outstocksuccess td[data-field="operate"],
#outstockcheck th[data-table-preference-field="operate"],
#outstockcheck td[data-table-preference-field="operate"],
#outstocksuccess th[data-table-preference-field="operate"],
#outstocksuccess td[data-table-preference-field="operate"],
#outstockcheck .fixed-columns-right th[data-field="operate"],
#outstockcheck .fixed-columns-right td[data-field="operate"],
#outstocksuccess .fixed-columns-right th[data-field="operate"],
#outstocksuccess .fixed-columns-right td[data-field="operate"],
#outstockcheck .fixed-columns-right th[data-table-preference-field="operate"],
#outstockcheck .fixed-columns-right td[data-table-preference-field="operate"],
#outstocksuccess .fixed-columns-right th[data-table-preference-field="operate"],
#outstocksuccess .fixed-columns-right td[data-table-preference-field="operate"] {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    white-space: nowrap !important;
    box-sizing: border-box;
}

#outstockcheck td[data-field="operate"] > .records,
#outstocksuccess td[data-field="operate"] > .records,
#outstockcheck td[data-table-preference-field="operate"] > .records,
#outstocksuccess td[data-table-preference-field="operate"] > .records,
#outstockcheck .fixed-columns-right td[data-field="operate"] > .records,
#outstocksuccess .fixed-columns-right td[data-field="operate"] > .records {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 4px 0 0;
    white-space: nowrap;
    vertical-align: middle;
}

/* Shared window controls: same round surface for Layer, Bootstrap and workbench panels. */
.layui-layer .layui-layer-setwin {display:flex;align-items:center;gap:7px;right:12px;top:10px;height:26px;}
.layui-layer.layui-layer-fast .layui-layer-title ~ .layui-layer-setwin {top:9px;height:26px;}
.layui-layer .layui-layer-setwin > a,
.layui-layer.layui-layer-fast .layui-layer-title ~ .layui-layer-setwin > a,
.modal-header > .close, [data-widget="collapse"], [data-widget="remove"], [data-collapse-toggle]:not(.ui-preference-section__title), .btn-inline-quote-expand {
    position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;
    width:26px;height:26px;min-width:26px;padding:0;margin:0;border:1px solid rgba(110,122,140,.18);
    border-radius:50%;background:rgba(116,128,148,.12) !important;color:#657287 !important;
    font-size:0;line-height:1;opacity:1;box-shadow:0 1px 2px rgba(25,40,65,.08);text-decoration:none;
}
.layui-layer .layui-layer-setwin > a:after,.modal-header > .close:after,
[data-widget="collapse"]:after,[data-widget="remove"]:after,[data-collapse-toggle]:not(.ui-preference-section__title):after,.btn-inline-quote-expand:after {
    content:'−';position:static;display:block !important;margin:0;font:18px/1 Arial,sans-serif;color:inherit !important;
}
.layui-layer .layui-layer-setwin .layui-layer-max:after {content:'□';font-size:17px;}
.layui-layer .layui-layer-setwin .layui-layer-maxmin:after {content:'▱';}
.layui-layer .layui-layer-setwin .layui-layer-close:after,.modal-header > .close:after,[data-widget="remove"]:after {content:'×';}
.layui-layer .layui-layer-setwin .layui-layer-close2 {top:0;right:0;}
.layui-layer .layui-layer-setwin > a cite,.modal-header > .close > span,
[data-widget="collapse"] > i,[data-widget="remove"] > i,[data-collapse-toggle]:not(.ui-preference-section__title) > *, .btn-inline-quote-expand > i {display:none;}
[data-collapse-toggle]:not(.ui-preference-section__title)[aria-expanded="false"]:after {content:'+';}
.btn-inline-quote-expand:after {content:'↗';font-size:16px;}
.is-expanded .btn-inline-quote-expand:after {content:'↙';}
.layui-layer .layui-layer-setwin > a:hover,.modal-header > .close:hover,[data-collapse-toggle]:not(.ui-preference-section__title):hover,.btn-inline-quote-expand:hover {background:rgba(90,111,145,.22) !important;}
.layui-layer .layui-layer-setwin > a:focus-visible,.modal-header > .close:focus-visible,[data-collapse-toggle]:not(.ui-preference-section__title):focus-visible,.btn-inline-quote-expand:focus-visible {outline:2px solid #3478f6;outline-offset:2px;}
.crm-table-column-picker {display:inline-block;position:relative;margin-left:6px;vertical-align:middle;}
.crm-table-column-picker > button {width:30px;height:28px;padding:4px;border-radius:7px;font-size:12px;}
.crm-table-column-picker > .dropdown-menu {right:0;left:auto;min-width:190px;max-height:min(55vh,420px);overflow:auto;padding:7px;}
.crm-table-column-picker > .dropdown-menu label {display:flex;align-items:center;gap:7px;padding:5px 7px;font-size:12px;white-space:nowrap;}
/* A source quote is a fact, while its native read receipt is unknown. */
.bootstrap-table .table > tbody > tr.erp-quote-row-source-quoted > td,
.bootstrap-table .table > tbody > tr.crm-quote-row-source-quoted > td {background-color:var(--quote-status-color-source-quoted,#EAF4FF) !important;color:#243044 !important;}
.quote-state-legend {display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:5px 0;color:#657287;font-size:11px;}
.quote-state-legend span:before {content:'';display:inline-block;width:9px;height:9px;border:1px solid rgba(70,80,100,.2);border-radius:3px;background:var(--legend-color);margin-right:4px;}

.layui-layer.layui-layer-fast .layui-layer-setwin .layui-layer-close2 {background:rgba(116,128,148,.12) !important;top:0;right:0;}
@media (max-width:640px) {
    /* Keep shared dialog controls reachable when a caller supplies a desktop pixel width. */
    .layui-layer:not(.layui-layer-tips):not(.layui-layer-msg) {max-width:calc(100vw - 16px);left:8px !important;}
}

html.quote-status-colors-disabled .bootstrap-table .table > tbody > tr.erp-quote-row-source-quoted > td,
html.quote-status-colors-disabled .bootstrap-table .table > tbody > tr.crm-quote-row-source-quoted > td {background-color:transparent !important;}
.bootstrap-table .table > tbody > tr.erp-quote-row-quoted-unread > td,
.bootstrap-table .table > tbody > tr.crm-quote-row-quoted-unread > td {color:var(--quote-status-text-quoted-unread,#243044) !important;}

.main-header [data-toggle="fullscreen"], [data-system-settings-close] {display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;margin:8px 5px;border:1px solid rgba(110,122,140,.18);border-radius:50%;background:rgba(116,128,148,.12);color:#657287;font-size:0;}
.main-header [data-toggle="fullscreen"] > i,[data-system-settings-close] > i {display:none;}
.main-header [data-toggle="fullscreen"]:after {content:'↗';font:16px/1 Arial,sans-serif;}
.main-header [data-toggle="fullscreen"].crm-fullscreen-active:after {content:'↙';}
[data-system-settings-close]:after {content:'×';font:18px/1 Arial,sans-serif;}
.main-header [data-toggle="fullscreen"]:focus-visible,[data-system-settings-close]:focus-visible {outline:2px solid #3478f6;outline-offset:2px;}
.ui-preference-section__title .ui-section-chevron {display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:rgba(116,128,148,.12);color:#657287;}
/* Legacy titleless Layer windows specify each icon separately. Keep the control component uniform. */
.layui-layer.layui-layer-fast .layui-layer-setwin > a {width:26px !important;height:26px !important;border-radius:50% !important;margin:0;line-height:1;}
.layui-layer.layui-layer-fast .layui-layer-setwin > a {background:rgba(116,128,148,.12) !important;border:1px solid rgba(110,122,140,.18) !important;}
.layui-layer.layui-layer-fast .layui-layer-setwin .layui-layer-min:after {content:'−';}
.layui-layer.layui-layer-fast .layui-layer-setwin .layui-layer-max:after {content:'□';}
.layui-layer.layui-layer-fast .layui-layer-setwin .layui-layer-maxmin:after {content:'▱';}
.layui-layer.layui-layer-fast .layui-layer-setwin .layui-layer-close:after {content:'×';}
.main-header [data-toggle="fullscreen"] {padding:0 !important;border-radius:50% !important;line-height:26px !important;}
