/* Icon-only search/add actions, including controls inserted into modals/AJAX results. */
html body :is(button,a.btn):is(.app-search-icon-button,.app-add-icon-button) {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:0;
    box-sizing:border-box;
    flex:0 0 var(--app-action-target,36px);
    width:var(--app-action-target,36px) !important;
    min-width:var(--app-action-target,36px) !important;
    max-width:var(--app-action-target,36px) !important;
    height:var(--app-action-target,36px) !important;
    min-height:var(--app-action-target,36px) !important;
    max-height:var(--app-action-target,36px) !important;
    padding:0 !important;
    border-radius:50% !important;
    vertical-align:middle;
}

/* Legacy white add actions need a visible surface, like standalone search actions. */
html body :is(button,a.btn).app-add-icon-button:is(.bg-white,.btn-default) {
    background:var(--app-shell-color,#222d32)!important;
    border-color:transparent!important;
    color:#fff!important;
}
html body :is(button,a.btn).app-add-icon-button > :is(i,svg) {color:inherit}

/* Search-only and search/create input groups: keep the original controls and handlers while
   preventing Bootstrap's joined-button corners and negative margins. */
html body .input-group:has(> .input-group-btn > .app-search-icon-button) {
    display:flex;
    align-items:center;
    gap:6px;
    width:100%;
}
html body .input-group:has(> .input-group-btn > .app-search-icon-button) > .form-control {
    float:none;
    flex:1 1 0;
    width:0;
    min-width:0;
    margin:0;
}
html body .input-group:has(> .input-group-btn > .app-search-icon-button) > .input-group-btn {
    display:flex;
    align-items:center;
    gap:6px;
    flex:0 0 auto;
    width:auto;
    padding:0;
}
html body .input-group:has(> .input-group-btn > .app-search-icon-button) > .input-group-btn > :is(button,a.btn):is(.app-search-icon-button,.app-add-icon-button) {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    float:none;
    flex:0 0 var(--app-action-target,36px);
    width:var(--app-action-target,36px)!important;
    min-width:var(--app-action-target,36px)!important;
    max-width:var(--app-action-target,36px)!important;
    height:var(--app-action-target,36px)!important;
    min-height:var(--app-action-target,36px)!important;
    max-height:var(--app-action-target,36px)!important;
    padding:0!important;
    margin:0!important;
    border-radius:50%!important;
}

/* Client type selector only; unrelated dropdowns keep their own presentation. */
html body .input-group-btn.app-client-type-menu {position:relative;vertical-align:middle}
html body .app-client-type-menu > button[data-toggle="dropdown"] {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    box-sizing:border-box;
    flex:0 0 48px;
    width:48px;
    min-width:48px;
    height:var(--app-action-target,36px);
    margin:0;
    padding:0;
    border:1px solid transparent;
    border-radius:4px!important;
    background:var(--app-shell-color,#222d32)!important;
    color:#fff!important;
    font-size:0;
    vertical-align:middle;
}
html body .app-client-type-menu > button[data-toggle="dropdown"]::before {
    content:"\f007";
    font:normal 15px/1 FontAwesome;
}
html body .app-client-type-menu > button[data-toggle="dropdown"] > .fa-caret-down {font-size:11px}
html body .app-client-type-menu > button[data-toggle="dropdown"]:hover {filter:brightness(1.12)}
html body .app-client-type-menu > button[data-toggle="dropdown"]:focus-visible {outline:3px solid var(--app-focus-color,#005a85);outline-offset:2px}
html body .app-client-type-menu > .dropdown-menu {
    min-width:214px;
    max-width:calc(100vw - 32px);
    margin:6px 0 0;
    padding:4px;
    background:#fff;
    border:1px solid #e4e6ef;
    border-radius:0;
    box-shadow:0 4px 12px rgba(15,23,42,.12);
}
html body .app-client-type-menu > .dropdown-menu > li > a {
    display:flex;
    align-items:center;
    gap:10px;
    min-height:42px;
    padding:7px 10px;
    color:#34465b;
    font-size:13px;
    font-weight:600;
    line-height:1.4;
    white-space:normal;
}
html body .app-client-type-menu > .dropdown-menu > li > a::before {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 28px;
    height:28px;
    background:#f0f5f9;
    color:#197eaa;
    font:normal 14px/1 FontAwesome;
}
html body .app-client-type-menu .app-client-type-normal > a::before {content:"\f007"}
html body .app-client-type-menu .app-client-type-final > a::before {content:"\f07a"}
html body .app-client-type-menu > .dropdown-menu > li > a:hover,
html body .app-client-type-menu > .dropdown-menu > li > a:focus {background:#eef6fb;color:#164f70}
html body .app-client-type-menu > .dropdown-menu > .divider {height:1px;margin:3px 6px;background:#edf0f4}

/* Document actions: preserve native visibility and enable/disable behavior. */
html body .app-document-actions {
    box-sizing:border-box;
    width:100%!important;
    max-width:100%;
    float:none!important;
    clear:both;
    padding:12px 0 4px!important;
    text-align:center;
}
html body .app-document-actions > .app-document-action-slot:not([hidden]) {
    display:inline-block;
    float:none!important;
    width:auto!important;
    max-width:100%;
    padding:0!important;
    margin:0 6px 8px;
    vertical-align:middle;
}
html body button.app-document-action {
    align-items:center;
    justify-content:center;
    gap:8px;
    box-sizing:border-box;
    float:none;
    width:auto!important;
    min-width:156px;
    max-width:100%;
    min-height:42px;
    height:auto;
    padding:10px 20px!important;
    border:0!important;
    border-radius:6px!important;
    background:var(--app-shell-color,#222d32)!important;
    color:#fff!important;
    font:600 14px/1.45 'Titillium Web',sans-serif!important;
    text-align:center;
    white-space:normal;
    vertical-align:middle;
    transition:background-color .15s,color .15s,transform .15s;
}
/* Do not override hidden attributes or inline display:none set by the workflow. */
html body button.app-document-action:not([hidden]) {display:inline-flex}
html body button.app-document-action[data-document-action=preview] {
    background:#f7fafc!important;
    color:#285b7a!important;
    box-shadow:inset 0 0 0 1px #cbd8e5;
}
html body button.app-document-action[data-document-action=issue] {box-shadow:none}
html body button.app-document-action:not(:has(i,svg,img)) {gap:0}
html body button.app-document-action:not(:has(i,svg,img))::before {margin-right:8px;font:normal 15px/1 FontAwesome}
html body button.app-document-action[data-document-action=preview]:not(:has(i,svg,img))::before {content:"\f06e"}
html body button.app-document-action[data-document-action=issue]:not(:has(i,svg,img))::before {content:"\f1d8"}
html body button.app-document-action:hover:not(:disabled) {transform:translateY(-1px)}
html body button.app-document-action[data-document-action=preview]:hover:not(:disabled) {background:#eaf3f9!important}
html body button.app-document-action:focus-visible {outline:3px solid var(--app-focus-color,#005a85);outline-offset:3px}
html body button.app-document-action:disabled {cursor:not-allowed;opacity:.65}
@media(max-width:520px) {
    html body .app-document-actions > .app-document-action-slot:not([hidden]) {display:block;width:100%!important;margin:0 0 10px}
    html body button.app-document-action {width:100%!important;min-width:0}
}
@media(prefers-reduced-motion:reduce) {
    html body button.app-document-action {transition:none}
    html body button.app-document-action:hover:not(:disabled) {transform:none}
}

/* Business action standard. Scoped by button-presentation.js; never changes display,
   visibility, order, margins or form behavior. Five negative IDs intentionally outrank
   the four-ID compatibility bridge for legacy Blade declarations. Do not increase
   specificity elsewhere: use data-button-kind or data-button-standard="off". */
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4) {
    --app-button-bg:#fff;
    --app-button-fg:var(--app-shell-color,#222d32);
    --app-button-border:#9dbfce;
    --app-button-hover-bg:#edf6fb;
    --app-button-hover-fg:#125e84;
    box-sizing:border-box;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-height:var(--app-action-target,36px)!important;
    height:auto!important;
    padding:7px 14px!important;
    border:1px solid var(--app-button-border)!important;
    border-radius:5px!important;
    background:var(--app-button-bg)!important;
    color:var(--app-button-fg)!important;
    box-shadow:none!important;
    font-family:inherit!important;
    font-size:13px!important;
    font-weight:400!important;
    line-height:20px!important;
    letter-spacing:normal!important;
    text-align:center;
    text-decoration:none!important;
    text-shadow:none!important;
    text-transform:none!important;
    white-space:normal!important;
    max-width:100%!important;
    vertical-align:middle;
    cursor:pointer;
    transition:background-color .16s ease,color .16s ease,border-color .16s ease;
}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[data-app-button-kind=primary] {
    --app-button-bg:var(--app-shell-color,#222d32);--app-button-fg:#fff;--app-button-border:var(--app-shell-color,#222d32);
    --app-button-hover-bg:color-mix(in srgb,var(--app-shell-color,#222d32) 88%,white);--app-button-hover-fg:#fff;
}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[data-app-button-kind=secondary] {
    --app-button-bg:#fff;--app-button-fg:#42566b;--app-button-border:#ccd6e1;
    --app-button-hover-bg:#f0f4f8;--app-button-hover-fg:#2b4056;
}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[data-app-button-kind=danger] {
    --app-button-bg:#bf3541;--app-button-fg:#fff;--app-button-border:#bf3541;
    --app-button-hover-bg:#a32732;--app-button-hover-fg:#fff;
}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4):hover:not(:disabled):not([aria-disabled=true]):not(.disabled) {
    background:var(--app-button-hover-bg)!important;color:var(--app-button-hover-fg)!important;
}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4):focus-visible {outline:3px solid var(--app-focus-color,#005a85)!important;outline-offset:3px}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4):is(:disabled,[aria-disabled=true],.disabled) {opacity:.55!important;cursor:not-allowed!important}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4) > :is(i,svg) {color:inherit!important;vertical-align:middle}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[data-app-button-size=compact] {min-height:max(32px,var(--app-touch-target,0px))!important;padding:5px 11px!important}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[data-app-button-size=prominent] {min-height:max(40px,var(--app-touch-target,0px))!important;padding:9px 18px!important;font-weight:600!important}
/* Management actions share document-button geometry and the user's existing shell theme. */
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[data-app-button-look=management] {
    --app-button-bg:var(--app-shell-color,#222d32);--app-button-fg:#fff;--app-button-border:var(--app-shell-color,#222d32);
    --app-button-hover-bg:color-mix(in srgb,var(--app-shell-color,#222d32) 88%,white);--app-button-hover-fg:#fff;
    display:inline-flex;gap:8px;border-radius:5px!important;min-height:max(40px,var(--app-touch-target,0px))!important;padding:9px 16px!important;
    font-size:13px!important;font-weight:400!important;
}
html body [data-app-button-look=management][data-app-button-icon]:not(:has(i,svg,img))::before{display:inline-block;flex:0 0 auto;font:normal 14px/1 FontAwesome;pointer-events:none}
html body [data-app-button-icon=save]:not(:has(i,svg,img))::before{content:"\f0c7"}
html body [data-app-button-icon=add]:not(:has(i,svg,img))::before{content:"\f067"}
html body [data-app-button-icon=import]:not(:has(i,svg,img))::before{content:"\f093"}
html body [data-app-button-icon=sync]:not(:has(i,svg,img))::before{content:"\f021"}
html body [data-app-button-icon=save]{--app-button-glyph:url('../images/actions/save.svg')}
html body [data-app-button-icon=add]{--app-button-glyph:url('../images/actions/add.svg')}
html body [data-app-button-icon=import]{--app-button-glyph:url('../images/actions/import.svg')}
html body [data-app-button-icon=sync]{--app-button-glyph:url('../images/actions/sync.svg')}
html body input[data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[data-app-button-look=management][data-app-button-icon]{background-image:var(--app-button-glyph)!important;background-repeat:no-repeat!important;background-position:16px center!important;background-size:14px 14px!important;padding-left:38px!important}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[data-app-button-shape=text]:not(.btn-block) {width:auto!important}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[data-app-button-shape=icon] {
    flex:0 0 var(--app-action-target,36px);width:var(--app-action-target,36px)!important;min-width:var(--app-action-target,36px)!important;max-width:var(--app-action-target,36px)!important;
    height:var(--app-action-target,36px)!important;min-height:var(--app-action-target,36px)!important;max-height:var(--app-action-target,36px)!important;
    padding:0!important;border-radius:50%!important;line-height:calc(var(--app-action-target,36px) - 2px)!important;gap:0!important;
}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[data-app-button-shape=icon] > :is(i,svg) {margin:0!important}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[data-app-button-shape=icon] > .glyphicon {top:0}
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4):is(.app-search-icon-button,.app-add-icon-button) {
    --app-button-bg:var(--app-shell-color,#222d32);--app-button-fg:#fff;--app-button-border:var(--app-shell-color,#222d32);
    --app-button-hover-bg:color-mix(in srgb,var(--app-shell-color,#222d32) 88%,white);--app-button-hover-fg:#fff;
}
@media(prefers-reduced-motion:reduce) {html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4) {transition:none!important}}

/* Native hidden is authoritative even when legacy .btn declares display. */
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[hidden] {display:none!important}

/* Imports are secondary; saving remains the solid themed action. */
html body [data-app-button-kind]:not(#ef24-button-scope-0):not(#ef24-button-scope-1):not(#ef24-button-scope-2):not(#ef24-button-scope-3):not(#ef24-button-scope-4)[data-app-button-look=management][data-app-button-icon=import]{--app-button-bg:#fff;--app-button-fg:var(--app-shell-color,#222d32);--app-button-border:#ccd6e1;--app-button-hover-bg:#f0f4f8;--app-button-hover-fg:var(--app-shell-color,#222d32)}
html body input[data-app-button-icon=import]{--app-button-glyph:url('../images/actions/import-dark.svg')}
