/* Console action buttons. Load after workspace/mobile styles in every shell.
   Record cards, dial pads and scan quantity controls are different controls;
   their layout and state cues stay with their components. */
:root {
  --console-button-radius: 4px;
  --console-button-font: 13px;
  --console-button-weight: 500;
  --console-button-height: 32px;
  --console-button-touch-height: 44px;
  --console-button-scan-height: 48px;
}

/* Legacy warehouse action names share the same visual contract as .btn. */
:root :is(.btn, .wh-primary-action, .wh-secondary-action, .wh-danger-action,
  .whp-primary, .whp-secondary, .whp-modal-cancel, .wh-pack-button, .wh-recv-button,
  .primary-call, .call-action, .caller-actions button, .new-caller button,
  .transfer-panel button, .cs-assignee-button, .camera-search-button,
  .wh-po-page-button, .o_chat_join_btn) {
  border-radius: var(--console-button-radius);
  font-family: inherit;
  font-size: var(--console-button-font);
  font-weight: var(--console-button-weight);
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
  touch-action: manipulation;
}
:root .btn:not(.btn-link) {
  min-height: var(--console-button-height);
  padding: 5px 12px;
  justify-content: center;
  text-align: center;
  max-width: 100%;
}
:root .btn.btn-sm:not(.btn-link) { min-height: 28px; padding: 3px 8px; font-size: 12px; }
:root .btn.btn-lg:not(.btn-link), :root .btn.cs-customer-primary {
  min-height: 42px; padding: 9px 18px; font-size: 14px;
}
/* Primary task controls retain their operational size, not a separate style. */
:root :is(.wh-primary-action, .wh-secondary-action, .wh-danger-action,
  .whp-primary, .whp-secondary, .whp-modal-cancel, .wh-pack-button, .wh-recv-button) {
  min-height: var(--console-button-scan-height);
  padding: 8px 12px;
  border-width: 1px;
  border-style: solid;
}
:root :is(.wh-pack-button.is-large, .wh-bag-out-action) { min-height: 56px; }
:root .wh-recv-button.is-square { min-width: 48px; font-size: 22px; padding: 8px; }

/* Use the same neutral surface and hierarchy in each workspace. Brand-specific
   order/subscription colors and armed/danger states are intentionally retained. */
:root :is(.btn-secondary, .btn-light):not(.active):not(.is-active) {
  background: var(--o-sheet, #fff); border-color: var(--o-border, #d7e0d6);
  color: var(--o-text, #172019);
}
:root :is(.wh-secondary-action, .whp-secondary, .whp-modal-cancel, .wh-pack-button, .wh-recv-button):not(.is-primary):not(.is-danger):not(.is-active):not(.is-armed) {
  background: var(--o-sheet, #fff); border-color: var(--o-border, #d7e0d6);
  color: var(--o-text, #172019);
}
:root :is(.wh-primary-action, .whp-primary, .wh-pack-button.is-primary, .wh-recv-button.is-primary):not(.is-danger) {
  background: var(--o-brand, #459945); border-color: var(--o-brand, #459945); color: #fff;
}
:root :is(.btn-secondary, .btn-light):not(:disabled):hover {
  background: var(--o-brand-soft, #eef5ed); border-color: var(--o-border, #d7e0d6);
}
:root :is(.btn, .wh-primary-action, .wh-secondary-action, .wh-danger-action,
  .whp-primary, .whp-secondary, .whp-modal-cancel, .wh-pack-button, .wh-recv-button,
  .primary-call, .call-action, .caller-actions button, .new-caller button,
  .transfer-panel button):disabled { opacity: .5; cursor: not-allowed; }
:root :is(button, .btn, summary):focus-visible {
  outline: 2px solid var(--o-primary, #245b2a); outline-offset: 3px;
}

/* Workspace tabs use the Customer Service underline treatment. */
:root :is(.flt-tabs, .phone-board-tabs) {
  display: flex; gap: 0; padding: 0; border: 0;
  border-bottom: 1px solid var(--o-border); border-radius: 0;
  background: transparent; overflow-x: auto;
}
:root :is(.cs-customer-tab-headers button, .flt-tabs .flt-tab,
  .phone-board-tabs button, .pos-tabs > button:not(.btn)) {
  min-height: 48px; padding: 0 13px; border: 0;
  border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; color: var(--o-muted); box-shadow: none;
  font-family: inherit; font-size: 12px; font-weight: 700;
  white-space: nowrap; cursor: pointer;
}
:root :is(.cs-customer-tab-headers button, .flt-tabs .flt-tab,
  .phone-board-tabs button, .pos-tabs > button:not(.btn)).active {
  border-bottom-color: var(--o-primary); background: transparent;
  color: var(--o-primary); box-shadow: none;
}

@media (max-width: 720px), (pointer: coarse) {
  :root .btn:not(.btn-link), :root .btn.btn-sm:not(.btn-link),
  :root .btn.btn-lg:not(.btn-link), :root .btn.cs-customer-primary {
    min-height: var(--console-button-touch-height);
    white-space: normal;
  }
  :root :is(.caller-actions button, .new-caller button, .transfer-panel button,
    .cs-assignee-button, .o_chat_join_btn) { min-height: var(--console-button-touch-height); }
}

:root :is(.wh-primary-action, .whp-primary, .wh-pack-button.is-primary, .wh-recv-button.is-primary):not(.is-danger):not(:disabled):hover {
  filter: brightness(.92);
}

:root :is(.wh-danger-action, .whp-primary.is-danger, .whp-secondary.is-danger,
  .wh-pack-button.is-danger, .wh-recv-button.is-danger) {
  background: var(--o-danger, #dc3545); border-color: var(--o-danger, #dc3545); color: #fff;
}
