/* ==========================================================
   Shared application action buttons
   The Products form action is the visual sizing reference.
========================================================== */

:root {
    --crm-action-height: 32px;
    --crm-action-width: 132px;
    --crm-message-action-width: 72px;
    --crm-action-radius: 12px;
    --crm-action-font-family: "Inter", sans-serif;
    --crm-action-font-size: 10.5px;
    --crm-action-font-weight: 600;
    --crm-action-gap: 5px;
    --crm-action-icon-size: 11px;
    --crm-action-padding: 6px;
    --crm-action-group-gap: 7px;
    /* The one divider above every footer: forms, dialogs, message boxes and grid pagers. */
    --crm-footer-divider: #c3ccd8;
}

/* Normalize labelled application actions without changing icon-only controls. */
.crm-workspace .iv-btn,
.crm-workspace .section-add-button,
.crm-workspace .add-bill-line,
.crm-workspace .inventory-clear,
.crm-workspace .company-logo-upload-button,
.quick-entity-dialog footer .iv-btn,
.party-modal__footer .iv-btn,
.bfc-message-footer .bfc-btn {
    position: relative !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    height: var(--crm-action-height) !important;
    min-height: var(--crm-action-height) !important;
    width: var(--crm-action-width) !important;
    min-width: var(--crm-action-width) !important;
    padding: 0 20px !important;
    border-radius: var(--crm-action-radius) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: var(--crm-action-gap) !important;
    font-family: var(--crm-action-font-family) !important;
    font-size: var(--crm-action-font-size) !important;
    font-weight: var(--crm-action-font-weight) !important;
    line-height: 1 !important;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, filter .25s ease,
        border-color .25s ease, color .25s ease, background-color .25s ease !important;
}

/* Button normalization must never reveal actions that do not belong to the
   current message type (for example Yes/No on an Information message). */
.bfc-message-footer .bfc-btn[hidden] {
    display: none !important;
}

/* Dark (primary) action treatment: two shades darker than the pagination active-page blue (.party-page-btn.active). */
.crm-workspace .iv-btn-primary,
.crm-workspace .inventory-clear,
.crm-workspace .company-logo-upload-button,
.quick-entity-dialog footer .iv-btn-primary,
.party-modal__footer .iv-btn-primary,
.bfc-message-footer .bfc-btn:not(.secondary) {
    border: 2px solid #1e3a8a !important;
    background: linear-gradient(180deg, #172f68, #081841) !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(7, 19, 43, .28), inset 0 1px 1px rgba(255, 255, 255, .12) !important;
}

/* Login-card white action treatment. */
.crm-workspace .iv-btn-secondary,
.crm-workspace .iv-btn-outline,
.crm-workspace .section-add-button,
.crm-workspace .add-bill-line,
.quick-entity-dialog footer .iv-btn-secondary,
.party-modal__footer .iv-btn-secondary,
.bfc-message-footer .bfc-btn.secondary {
    border: 2px solid #1e3a8a !important;
    background: #e9edf1 !important;
    color: #1e3a8a !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04) !important;
}

/* Preserve Delete red, while giving it the identical interaction motion. */
.crm-workspace .iv-btn-danger {
    border: 2px solid #b91c1c !important;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 52%, #b91c1c 100%) !important;
    color: #fff !important;
}

/* Positive actions (e.g. Activate a workflow): the timeline's Mark as Complete green. */
.crm-workspace .iv-btn-success {
    border: 2px solid #3f4b22 !important;
    background: linear-gradient(180deg, #6b8e23 0%, #556b2f 52%, #3f4b22 100%) !important;
    color: #fff !important;
}

/* Upper glass highlight used by the Sign In button. */
.crm-workspace .iv-btn::before,
.crm-workspace .inventory-clear::before,
.crm-workspace .section-add-button::before,
.crm-workspace .add-bill-line::before,
.quick-entity-dialog footer .iv-btn::before,
.party-modal__footer .iv-btn::before,
.bfc-message-footer .bfc-btn::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 0 auto !important;
    height: 50% !important;
    border-radius: 12px 12px 100px 100px !important;
    background: linear-gradient(rgba(255, 255, 255, .22), rgba(255, 255, 255, 0)) !important;
    pointer-events: none !important;
}

/* Moving light sweep shared by blue, white and Delete actions. */
.crm-workspace .iv-btn::after,
.crm-workspace .inventory-clear::after,
.crm-workspace .section-add-button::after,
.crm-workspace .add-bill-line::after,
.quick-entity-dialog footer .iv-btn::after,
.party-modal__footer .iv-btn::after,
.bfc-message-footer .bfc-btn::after {
    content: "" !important;
    position: absolute !important;
    top: -60% !important;
    left: -35% !important;
    width: 45% !important;
    height: 220% !important;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, .05) 30%, rgba(255, 255, 255, .45) 50%, rgba(255, 255, 255, .05) 70%, transparent 100%) !important;
    transform: translateX(-180%) rotate(20deg) !important;
    transition: transform .9s cubic-bezier(.22, .61, .36, 1) !important;
    pointer-events: none !important;
}

.crm-workspace .iv-btn:hover:not(:disabled):not([aria-disabled="true"])::after,
.crm-workspace .inventory-clear:hover:not(:disabled):not([aria-disabled="true"])::after,
.crm-workspace .section-add-button:hover:not(:disabled):not([aria-disabled="true"])::after,
.crm-workspace .add-bill-line:hover:not(:disabled):not([aria-disabled="true"])::after,
.quick-entity-dialog footer .iv-btn:hover:not(:disabled):not([aria-disabled="true"])::after,
.party-modal__footer .iv-btn:hover:not(:disabled):not([aria-disabled="true"])::after,
.bfc-message-footer .bfc-btn:hover:not(:disabled):not([aria-disabled="true"])::after {
    transform: translateX(380%) rotate(20deg) !important;
}

.crm-workspace .iv-btn:hover:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .inventory-clear:hover:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .section-add-button:hover:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .add-bill-line:hover:not(:disabled):not([aria-disabled="true"]),
.quick-entity-dialog footer .iv-btn:hover:not(:disabled):not([aria-disabled="true"]),
.party-modal__footer .iv-btn:hover:not(:disabled):not([aria-disabled="true"]),
.bfc-message-footer .bfc-btn:hover:not(:disabled):not([aria-disabled="true"]) {
    transform: none !important;
    scale: 1 !important;
    filter: brightness(1.04) !important;
    border-color: #8adfff !important;
    box-shadow: 0 0 0 4px rgba(121, 212, 255, .30),
        0 0 20px rgba(121, 212, 255, .70),
        0 0 40px rgba(121, 212, 255, .50),
        0 18px 36px rgba(15, 23, 42, .20) !important;
}

.crm-workspace .iv-btn:active:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .inventory-clear:active:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .section-add-button:active:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .add-bill-line:active:not(:disabled):not([aria-disabled="true"]),
.quick-entity-dialog footer .iv-btn:active:not(:disabled):not([aria-disabled="true"]),
.party-modal__footer .iv-btn:active:not(:disabled):not([aria-disabled="true"]),
.bfc-message-footer .bfc-btn:active:not(:disabled):not([aria-disabled="true"]) {
    transform: none !important;
    filter: brightness(.98) !important;
}

.crm-workspace .iv-btn i,
.crm-workspace .section-add-button i,
.crm-workspace .add-bill-line i,
.crm-workspace .company-logo-upload-button i,
.quick-entity-dialog footer .iv-btn i,
.party-modal__footer .iv-btn i,
.bfc-message-footer .bfc-btn i {
    flex: 0 0 auto;
    font-size: 14px !important;
    line-height: 1 !important;
}

/* A 32px action needs only 4px above and below in a docked footer. */
.crm-workspace .inventory-form-page .record-action-footer,
.crm-workspace .account-editor .record-action-footer,
.crm-workspace .record-action-footer {
    box-sizing: border-box;
    height: 40px !important;
    min-height: 40px !important;
    flex-basis: 40px !important;
    padding: 4px 8px !important;
}

.quick-entity-dialog footer,
.party-modal__footer,
.bfc-message-footer {
    box-sizing: border-box;
    height: 40px !important;
    min-height: 40px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

/* Keep quick-create actions clear of the popup's rounded lower edge. */
.quick-entity-dialog footer {
    display: flex !important;
    width: 100%;
    height: 56px !important;
    min-height: 56px !important;
    flex: 0 0 56px;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px !important;
    padding-right: 18px !important;
    padding-bottom: 12px !important;
    padding-left: 18px !important;
    border-top: 1px solid #c7d2e0 !important;
    background: #f4f7fa !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}

/* Leave comfortable breathing room below message-box actions. */
.bfc-message-footer {
    height: auto !important;
    min-height: 46px !important;
    padding: 4px 10px 10px !important;
}

/* Message-box labels are short, so keep their actions compact and equal. */
.bfc-message-footer .bfc-btn {
    box-sizing: border-box !important;
    width: var(--crm-message-action-width) !important;
    min-width: var(--crm-message-action-width) !important;
    max-width: var(--crm-message-action-width) !important;
    flex: 0 0 var(--crm-message-action-width) !important;
}

.bfc-message-footer > #bfcBtnYes,
.bfc-message-footer > #bfcBtnNo,
.bfc-message-footer > #bfcBtnOk {
    box-sizing: border-box !important;
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    flex: 0 0 72px !important;
}

@media (max-width: 700px) {
    .crm-workspace .iv-btn,
    .crm-workspace .section-add-button,
    .crm-workspace .add-bill-line,
    .crm-workspace .inventory-clear,
    .crm-workspace .company-logo-upload-button,
    .quick-entity-dialog footer .iv-btn,
    .party-modal__footer .iv-btn {
        min-width: 0 !important;
        padding-right: 8px !important;
        padding-left: 8px !important;
    }

    .crm-workspace .iv-btn,
    .quick-entity-dialog footer .iv-btn,
    .party-modal__footer .iv-btn {
        width: 100% !important;
    }

    .crm-workspace .section-add-button,
    .crm-workspace .add-bill-line,
    .crm-workspace .inventory-clear,
    .crm-workspace .company-logo-upload-button {
        width: auto !important;
    }

    .crm-workspace .inventory-form-page .record-action-footer,
    .crm-workspace .account-editor .record-action-footer,
    .crm-workspace .record-action-footer {
        height: auto !important;
        min-height: 44px !important;
        flex-basis: auto !important;
        padding: 6px 8px max(6px, env(safe-area-inset-bottom)) !important;
    }

    /* Preserve the requested two-row mobile layout: left actions, then right actions. */
    .crm-workspace .record-action-footer:has(.record-action-footer__left > *),
    .crm-workspace .inventory-form-page .record-action-footer:has(.record-action-footer__left > *),
    .crm-workspace .account-editor .record-action-footer:has(.record-action-footer__left > *) {
        height: auto !important;
        min-height: 82px !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* Final desktop width authority for every full-size application action.
   Width and flex-basis are both fixed so legacy flex rules cannot shrink
   individual labels such as Add Product, Add Brand, or Add Stock. */
@media (min-width: 701px) {
    .crm-shell .crm-workspace .inventory-form-page .record-action-footer .iv-btn,
    .crm-shell .crm-workspace .account-editor .record-action-footer .iv-btn,
    .crm-shell .crm-workspace .inventory-page > .inventory-heading > .iv-btn,
    .crm-shell .crm-workspace .inventory-empty .iv-btn,
    .quick-entity-dialog footer .iv-btn,
    .party-modal__footer .iv-btn {
        width: var(--crm-action-width) !important;
        min-width: var(--crm-action-width) !important;
        max-width: var(--crm-action-width) !important;
        flex: 0 0 var(--crm-action-width) !important;
    }
}

/* Keep the shared moving-light hover treatment inside pagination controls. */
.crm-workspace .party-page-btn {
    overflow: hidden;
}

.crm-workspace .party-page-btn::after {
    content: "";
    position: absolute;
    top: -60%;
    left: -35%;
    width: 45%;
    height: 220%;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, .05) 30%, rgba(255, 255, 255, .55) 50%, rgba(255, 255, 255, .05) 70%, transparent 100%);
    transform: translateX(-180%) rotate(20deg);
    transition: transform .7s cubic-bezier(.22, .61, .36, 1);
    pointer-events: none;
}

.crm-workspace .party-page-btn:hover:not(:disabled):not([aria-disabled="true"])::after {
    transform: translateX(420%) rotate(20deg);
}

/* Compact actions displayed inside page and card section headers. */
.crm-workspace .inventory-heading > .iv-btn,
.crm-workspace .form-section-heading > .iv-btn,
.crm-workspace .form-section-heading > .add-bill-line,
.crm-workspace .section-grid-tools .section-add-button {
    height: 32px !important;
    min-height: 32px !important;
    padding-right: 12px !important;
    padding-left: 12px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    line-height: 1 !important;
}

.crm-workspace .inventory-heading > .iv-btn i,
.crm-workspace .form-section-heading > .iv-btn i,
.crm-workspace .form-section-heading > .add-bill-line i,
.crm-workspace .section-grid-tools .section-add-button i {
    font-size: 14px !important;
}

/* Keep record deletion visible as the left-hand Edit action after all legacy
   footer rules have been applied. */
.crm-workspace .record-action-footer__left:not(:empty) {
    display: flex !important;
    min-width: 96px;
    align-items: center;
    visibility: visible !important;
    opacity: 1 !important;
}

.crm-workspace .record-action-footer__left .iv-btn-danger,
.crm-workspace .record-action-footer__left .iv-btn-success {
    display: inline-flex !important;
    position: relative !important;
    z-index: 1;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Final Add New authority. Index-header and no-record actions use one compact
   size and the same primary treatment as Save, regardless of legacy outline
   classes retained in individual views. */
.crm-shell .crm-workspace .inventory-page:not(.inventory-form-page) > .inventory-heading > .iv-btn,
.crm-shell .crm-workspace .inventory-empty > .iv-btn,
.crm-shell .crm-workspace .inventory-empty > a.iv-btn,
.crm-shell .crm-workspace .inventory-empty > button.iv-btn {
    width: var(--crm-action-width) !important;
    min-width: var(--crm-action-width) !important;
    max-width: var(--crm-action-width) !important;
    height: var(--crm-action-height) !important;
    min-height: var(--crm-action-height) !important;
    flex: none !important;
    padding: 0 12px !important;
    border: 2px solid #1e3a8a !important;
    border-radius: 10px !important;
    background: linear-gradient(180deg, #172f68, #081841) !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(7, 19, 43, .28), inset 0 1px 1px rgba(255, 255, 255, .12) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
}

.crm-shell .crm-workspace .inventory-page:not(.inventory-form-page) > .inventory-heading > .iv-btn:hover:not(:disabled):not([aria-disabled="true"]),
.crm-shell .crm-workspace .inventory-empty > .iv-btn:hover:not(:disabled):not([aria-disabled="true"]) {
    border-color: #8adfff !important;
    color: #fff !important;
    filter: brightness(1.04) !important;
}

@media (max-width: 700px) {
    .crm-shell .crm-workspace .inventory-page:not(.inventory-form-page) > .inventory-heading > .iv-btn {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }
}

.crm-workspace .record-action-footer:has(.record-action-footer__left > *) {
    display: flex !important;
    justify-content: space-between !important;
}

@media (max-width: 700px) {
    .crm-workspace .record-action-footer:has(.record-action-footer__left > *) {
        flex-direction: column !important;
    }

    .crm-workspace .record-action-footer__left:not(:empty) {
        display: grid !important;
        width: 100%;
    }
}

/* Disabled record actions stay readable without translucent text or hover glow. */
.crm-workspace .record-action-footer .iv-btn:disabled {
    opacity: 1 !important;
    cursor: not-allowed !important;
    color: #475569 !important;
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    box-shadow: none !important;
    filter: none !important;
}

.crm-workspace .record-action-footer .iv-btn:disabled::before,
.crm-workspace .record-action-footer .iv-btn:disabled::after {
    content: none !important;
}

/* Disabled actions cannot trigger shared or legacy hover/press effects. */
:is(.crm-workspace, .quick-entity-dialog footer, .party-modal__footer, .bfc-message-footer)
:is(.iv-btn, .inventory-clear, .section-add-button, .add-bill-line, .company-logo-upload-button, .party-page-btn, .bfc-btn):is(:disabled, [aria-disabled="true"]) {
    pointer-events: none !important;
    transition: none !important;
    animation: none !important;
    transform: none !important;
    scale: 1 !important;
    filter: none !important;
}

:is(.crm-workspace, .quick-entity-dialog footer, .party-modal__footer, .bfc-message-footer)
:is(.iv-btn, .inventory-clear, .section-add-button, .add-bill-line, .company-logo-upload-button, .party-page-btn, .bfc-btn):is(:disabled, [aria-disabled="true"])::after {
    content: none !important;
    transition: none !important;
    animation: none !important;
}

/* Products is the single sizing reference for all labelled actions. This rule
   wins over legacy page, footer, modal and authentication size overrides. */
:is(.crm-shell .crm-workspace .inventory-form-page .record-action-footer,
    .crm-shell .crm-workspace, .login-page .login-card,
    .quick-entity-dialog, .party-modal__footer, .bfc-message-footer,
    .print-toolbar, .error-card)
:is(.iv-btn, .inventory-clear, .section-add-button, .add-bill-line,
    .company-logo-upload-button, .bfc-btn, .document-print-action) {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--crm-action-width) !important;
    min-width: var(--crm-action-width) !important;
    max-width: var(--crm-action-width) !important;
    flex: 0 0 var(--crm-action-width) !important;
    height: var(--crm-action-height) !important;
    min-height: var(--crm-action-height) !important;
    max-height: var(--crm-action-height) !important;
    padding: 0 var(--crm-action-padding) !important;
    gap: var(--crm-action-gap) !important;
    border-width: 2px !important;
    border-style: solid !important;
    border-radius: var(--crm-action-radius) !important;
    font-family: var(--crm-action-font-family) !important;
    font-size: var(--crm-action-font-size) !important;
    font-weight: var(--crm-action-font-weight) !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    text-align: center !important;
    white-space: normal !important;
    overflow: hidden !important;
    vertical-align: middle;
}

:is(.crm-shell .crm-workspace .inventory-form-page .record-action-footer,
    .crm-shell .crm-workspace, .login-page .login-card,
    .quick-entity-dialog, .party-modal__footer, .bfc-message-footer, .print-toolbar, .error-card)
:is(.iv-btn, .inventory-clear, .section-add-button, .add-bill-line,
    .company-logo-upload-button, .bfc-btn, .document-print-action) i {
    font-size: var(--crm-action-icon-size) !important;
    line-height: 1 !important;
    flex: 0 0 auto !important;
}

/* Products' compact hover glow is shared by every labelled action. */
:is(.crm-shell .crm-workspace .inventory-form-page .record-action-footer,
    .crm-shell .crm-workspace, .login-page .login-card,
    .quick-entity-dialog, .party-modal__footer, .bfc-message-footer, .print-toolbar, .error-card)
:is(.iv-btn, .inventory-clear, .section-add-button, .add-bill-line,
    .company-logo-upload-button, .bfc-btn, .document-print-action):hover:not(:disabled):not([aria-disabled="true"]) {
    transform: none !important;
    scale: 1 !important;
    box-shadow: 0 0 0 2px rgba(121, 212, 255, .24), 0 3px 8px rgba(7, 19, 43, .18) !important;
}

/* Equal-sized actions wrap as groups rather than shrinking individual buttons. */
.crm-shell .crm-workspace .inventory-form-page .record-action-footer,
.crm-shell .crm-workspace .record-action-footer {
    height: auto !important;
    min-height: 40px !important;
    max-height: none !important;
    flex-basis: auto !important;
    flex-wrap: wrap !important;
    gap: var(--crm-action-group-gap) !important;
    overflow: visible !important;
}
.crm-shell .crm-workspace .record-action-footer .record-action-footer__left,
.crm-shell .crm-workspace .record-action-footer .record-action-footer__right,
.quick-entity-dialog footer, .party-modal__footer, .bfc-message-footer, .print-toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: var(--crm-action-group-gap) !important;
    height: auto !important;
    max-height: none !important;
    min-width: 0 !important;
}
.crm-shell .crm-workspace .record-action-footer .record-action-footer__left { justify-content: flex-start !important; }
.crm-shell .crm-workspace .record-action-footer .record-action-footer__right { justify-content: flex-end !important; }
.crm-shell .crm-workspace .record-action-footer form { margin: 0; }

/* Do not expose hidden conditional actions when normalizing their display. */
body :is(.crm-shell .crm-workspace .inventory-form-page .record-action-footer,
    .crm-shell .crm-workspace, .login-page .login-card, .quick-entity-dialog,
    .party-modal__footer, .bfc-message-footer, .print-toolbar, .error-card)
:is(.iv-btn, .inventory-clear, .section-add-button, .add-bill-line,
    .company-logo-upload-button, .bfc-btn, .document-print-action)[hidden] {
    display: none !important;
}
@media print {
    .print-toolbar { display: none !important; }
    body:has(.challan-view-page) .crm-shell .crm-workspace .record-action-footer { display: none !important; }
}

/* Actions that sit on a dark-navy section title bar: compact raised pearl-white keys with navy text and a navy rim. Same 3-stop gradient + inset highlight recipe as the
   app's other raised buttons (.iv-btn-primary / Mark as Complete). */
.crm-workspace .form-section-heading .section-add-button:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .form-section-heading .add-bill-line:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .form-section-heading > .iv-btn:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .form-section-heading .section-grid-tools .iv-btn:not(:disabled):not([aria-disabled="true"]) {
    /* An explicit width, never auto: with width:auto the 132px came only from flex-basis, and Safari sizes the
       wrapping .section-grid-tools from the label (~94px) instead, so the button spilled past the panel edge
       (Field Explorer New Field). Chrome already rendered 132px, so nothing changes there. */
    width: var(--crm-action-width) !important;
    min-width: var(--crm-action-width) !important;
    height: 26px !important;
    min-height: 26px !important;
    padding: 0 11px !important;
    gap: 5px !important;
    border-radius: 8px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    border: 1.5px solid #b9c6d8 !important;
    background: #fff !important;
    color: #1e3a8a !important;
    box-shadow: 0 4px 10px rgba(2, 8, 30, .45), inset 0 -2px 3px rgba(185, 198, 216, .55) !important;
    transition: transform .15s cubic-bezier(.34, 1.56, .64, 1), box-shadow .15s, filter .15s !important;
}
.crm-workspace .form-section-heading .section-add-button:hover:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .form-section-heading .add-bill-line:hover:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .form-section-heading > .iv-btn:hover:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .form-section-heading .section-grid-tools .iv-btn:hover:not(:disabled):not([aria-disabled="true"]) {
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(2, 8, 30, .5), inset 0 -2px 3px rgba(185, 198, 216, .55) !important;
}
.crm-workspace .form-section-heading .section-add-button:active:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .form-section-heading .add-bill-line:active:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .form-section-heading > .iv-btn:active:not(:disabled):not([aria-disabled="true"]),
.crm-workspace .form-section-heading .section-grid-tools .iv-btn:active:not(:disabled):not([aria-disabled="true"]) {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(2, 8, 30, .45), inset 0 2px 4px rgba(185, 198, 216, .8) !important;
}
.crm-workspace .form-section-heading .section-add-button i,
.crm-workspace .form-section-heading .add-bill-line i,
.crm-workspace .form-section-heading > .iv-btn i,
.crm-workspace .form-section-heading .section-grid-tools .iv-btn i { color: #1e3a8a !important; font-size: 12px !important; }

/* Search box beside those buttons: same height as the buttons. */
.crm-workspace .form-section-heading .section-grid-search {
    height: 26px !important;
    min-height: 26px !important;
    border-radius: 8px !important;
}
.crm-workspace .form-section-heading .section-grid-search input {
    height: 24px !important;
    min-height: 0 !important;
    line-height: 24px !important;
    font-size: 11px !important;
}
.crm-workspace .form-section-heading .section-grid-search i { height: 16px !important; }

/* Footer divider: a slightly visible top rule on every footer across the app - all
   popups (.party-modal, native quick-entity dialogs, the record dialog), message boxes and grid /
   subgrid pagers. New footers should reuse these classes (or var(--crm-footer-divider)). */
.party-modal__footer,
.quick-entity-dialog footer,
.quick-entity-dialog[open] > form > footer,
.bfc-message-footer,
.subgrid-lookup__footer,
.designer-explorer__footer,
.crm-workspace .party-grid-pagination {
    border-top: 1px solid var(--crm-footer-divider) !important;
}

/* Index page heading actions: Export, Import, Download Template, then Add New (index-data-transfer.js). The group keeps
   Add New exactly as it looks as the heading's own button; the Excel actions use the same compact size, white treatment. */
.crm-workspace .inventory-heading > .index-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.crm-shell .crm-workspace .inventory-heading > .index-heading-actions > .iv-btn {
    width: auto !important;
    min-width: var(--crm-action-width) !important;
    max-width: none !important;
    height: var(--crm-action-height) !important;
    min-height: var(--crm-action-height) !important;
    flex: none !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
}

.crm-shell .crm-workspace .inventory-heading > .index-heading-actions > .iv-btn-primary {
    width: var(--crm-action-width) !important;
    max-width: var(--crm-action-width) !important;
}

.crm-workspace .inventory-heading > .index-heading-actions > .iv-btn i {
    font-size: 14px !important;
}

/* Inside a page's own heading group (Accounts / Contacts Merge, Delivery Challans) the long label still fits. */
.crm-workspace .inventory-heading [data-transfer-template] {
    width: auto !important;
}

@media (max-width: 700px) {
    .crm-workspace .inventory-heading > .index-heading-actions {
        width: 100%;
        margin-left: 0;
    }

    .crm-shell .crm-workspace .inventory-heading > .index-heading-actions > .iv-btn {
        flex: 1 1 calc(50% - 4px) !important;
        min-width: 0 !important;
        max-width: none !important;
    }
}

/* Excel actions use the shared secondary button format in every index heading group. */
.crm-shell .crm-workspace .inventory-page .inventory-heading .iv-btn:is([data-transfer-export], [data-transfer-import], [data-transfer-template]) {
    height: var(--crm-action-height) !important;
    min-height: var(--crm-action-height) !important;
    padding: 0 20px !important;
    border-radius: var(--crm-action-radius) !important;
    font-family: var(--crm-action-font-family) !important;
    font-size: var(--crm-action-font-size) !important;
    font-weight: var(--crm-action-font-weight) !important;
    gap: var(--crm-action-gap) !important;
    white-space: nowrap !important;
}
.crm-shell .crm-workspace .inventory-page .inventory-heading .iv-btn:is([data-transfer-export], [data-transfer-import], [data-transfer-template]) i {
    font-size: var(--crm-action-icon-size) !important;
}

/* Long template labels need intrinsic width, including Accounts/Contacts' Merge action group. */
.crm-shell .crm-workspace .inventory-page .inventory-heading .iv-btn[data-transfer-template] {
    width: auto !important;
    min-width: var(--crm-action-width) !important;
    max-width: none !important;
    flex: 0 0 auto !important;
}

/* Compact Excel launcher and full-width actions in its shared pointer popup. */
.crm-shell .crm-workspace .inventory-page .inventory-heading .index-transfer-toggle.iv-btn,
.crm-workspace .index-transfer-toggle.iv-btn {
    width:32px!important; min-width:32px!important; max-width:32px!important;
    flex:0 0 32px!important; padding:0!important; border-radius:var(--crm-action-radius)!important;
}
.crm-workspace .index-transfer-toggle.iv-btn i { font-size:var(--crm-action-icon-size)!important; }
.crm-workspace .index-transfer-menu .iv-btn {
    width:auto!important; min-width:var(--crm-action-width)!important; max-width:none!important;
    padding:0 12px!important; justify-content:center!important; flex:none!important;
}
.crm-workspace .index-transfer-menu .iv-btn i { font-size:var(--crm-action-icon-size)!important; }
/* More Options actions keep every label on one line and share the widest action's width ("Change Business Unit" on the
   User / Team form): this outranks the shared fixed 132px action rule above, whose :is() list is more specific. */
.crm-shell .crm-workspace .index-transfer-menu.designer-field-popover .iv-btn.iv-btn {
    width:100%!important; min-width:var(--crm-action-width)!important; max-width:none!important; flex:none!important;
    white-space:nowrap!important; justify-content:center!important;
}

/* Footer action menu toggle (data-action-menu, more-options.js): one labelled button with a chevron that turns over
   while its pointer popup is open - "Print / PDF" on Sales Bill, Quotation and Delivery Challan (owner, 2026-10-16). */
.crm-shell .crm-workspace .action-menu-toggle.iv-btn { gap: 7px !important; }
.crm-shell .crm-workspace .action-menu-toggle .action-menu-caret { font-size: 9px; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.crm-shell .crm-workspace .action-menu-toggle[aria-expanded="true"] .action-menu-caret { transform: rotate(180deg); }
/* Without the script the wrapper just lays its buttons out inline. */
.crm-shell .crm-workspace .action-menu { display: contents; }
