/* Shared form controls, separate from compact table editors and navigation tabs. */
html body :is(.app form, .modal form, .admin-modal form) :is(
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
  select,
  button:not(.icon-button):not(.table-action-button):not([role="tab"]):not(.lead-template-rich-toolbar button)
):not(.table-wrap *) {
  box-sizing: border-box !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 4px !important;
  font-size: 13px !important;
  line-height: 18px !important;
}

html body :is(.app form, .modal form, .admin-modal form) :is(
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
  select,
  button:not(.icon-button):not(.table-action-button):not([role="tab"]):not(.lead-template-rich-toolbar button)
):not(.table-wrap *) {
  padding-left: 10px !important;
  padding-right: 10px !important;
}

html body :is(.app form, .modal form, .admin-modal form) select:not([multiple]):not(.table-wrap *) {
  appearance: none !important;
  -webkit-appearance: none !important;
  padding-right: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3.5 5.25 7 8.75l3.5-3.5' stroke='%23425555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px 14px !important;
}

html body :is(.app form, .modal form, .admin-modal form) textarea:not(.table-wrap *) {
  border-radius: 4px !important;
  font-size: 13px !important;
  line-height: 18px !important;
}

html body :is(.app, .modal, .admin-modal) .icon-button:not(.modal-backdrop) {
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border-radius: 4px !important;
}

html body :is(.app, .modal, .admin-modal) .primary-button:not(:disabled):not(#control-standard-specificity) {
  border-color: var(--brand-primary) !important;
  background: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: none !important;
}

html body :is(.app, .modal, .admin-modal) .primary-button:not(:disabled):not(#control-standard-specificity):hover {
  border-color: var(--brand-primary-hover) !important;
  background: var(--brand-primary-hover) !important;
  color: #fff !important;
}

html body :is(.app, .modal, .admin-modal) :is(.ghost-button, .neutral-button):not(:disabled):not(#control-standard-specificity) {
  border-color: #dde3e6 !important;
  background: #fff !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

html body :is(.app, .modal, .admin-modal) :is(.ghost-button, .neutral-button):not(:disabled):not(#control-standard-specificity):hover {
  background: var(--brand-hover) !important;
}

html body :is(.app, .modal, .admin-modal) .danger-button:not(.record-archive-button):not(:disabled):not(#control-standard-specificity) {
  border-color: #dde3e6 !important;
  background: #fff !important;
  color: #b42318 !important;
}

html body :is(.app, .modal, .admin-modal) .danger-button:not(.record-archive-button):not(:disabled):not(#control-standard-specificity):hover {
  background: #fef3f2 !important;
}

html body :is(.app, .modal, .admin-modal) :is(button, input, select, textarea, summary):disabled:not(#control-standard-specificity) {
  border-color: #dde3e6 !important;
  background-color: #f5f6f7 !important;
  color: #929ba2 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
}

html body :is(.app, .modal, .admin-modal) :is(button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--brand-primary) !important;
  outline-offset: 2px !important;
}

/* The same Add to Sequences action uses one row-button geometry in both modules. */
html body .app :is(#leadDirectoryPanel, #communicationPanel) table button:is(.ld-add-button, .outreach-sequence-add):not(#control-standard-specificity) {
  box-sizing: border-box !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 48px !important;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  margin: 0 !important;
  padding: 0 8px !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-radius: 4px !important;
  font-family: var(--font-main) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 18px !important;
  letter-spacing: 0 !important;
  white-space: nowrap;
}

html body .app :is(#leadDirectoryPanel, #communicationPanel) table button:is(.ld-add-button, .outreach-sequence-add):not(#control-standard-specificity):focus-visible {
  outline-offset: -2px !important;
}

html body .app table tbody tr.is-selected > td {
  background: var(--brand-selected) !important;
}

html body .app :is(
  .sidebar .nav button.nav-item.is-active,
  .sidebar .sidebar-module-submenu button.is-active,
  .sidebar .sidebar-admin button.sidebar-settings-button.is-active
):not(#control-standard-specificity) {
  background: var(--brand-selected) !important;
  color: var(--brand-accent) !important;
}

html body .app .sidebar :is(
  .nav button.nav-item:not(.is-access-disabled):not(:disabled),
  .sidebar-module-submenu button:not(.is-access-disabled):not(:disabled),
  .sidebar-admin button.sidebar-settings-button:not(:disabled)
):not(#control-standard-specificity) {
  color: #111 !important;
}

html body .app :is(
  .sidebar .nav button.nav-item:hover:not(.is-active),
  .sidebar .sidebar-module-submenu button:hover:not(.is-active),
  .sidebar .sidebar-admin button.sidebar-settings-button:hover:not(.is-active)
):not(#control-standard-specificity) {
  background: var(--brand-hover) !important;
}

html body .app .sc-contact-table tr.is-active > td {
  background: var(--brand-selected) !important;
}

html body .app input:is([type="checkbox"], [type="radio"]) {
  accent-color: var(--brand-primary);
}

html body .app .sidebar :is(
  .nav button.nav-item,
  .sidebar-module-submenu button.sidebar-submenu-item,
  .sidebar-module-submenu button.planning-tab,
  .sidebar-module-submenu button.client-module-tab,
  .sidebar-admin button.sidebar-settings-button,
  .sidebar-toggle,
  .sidebar-logout,
  .account-user
) {
  border-radius: 4px !important;
}

html body .app .oc-campaign :is(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  .oc-multi > summary,
  button.ghost-button,
  button.primary-button
) {
  box-sizing: border-box !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 4px !important;
  font-size: 13px !important;
  line-height: 18px !important;
}

html body .app .oc-campaign :is(input:not([type="checkbox"]), select) {
  padding-left: 10px !important;
  padding-right: 10px !important;
}

html body .app .oc-campaign select:not([multiple]) {
  appearance: none !important;
  -webkit-appearance: none !important;
  padding-right: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3.5 5.25 7 8.75l3.5-3.5' stroke='%23425555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px 14px !important;
}

html body .app .module-archive-panel :is(.module-archive-heading-actions, .module-archive-actions, .module-archive-pagination) :is(button, select) {
  box-sizing: border-box !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 4px !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
  font-size: 13px !important;
  line-height: 18px !important;
}

html body .app .module-archive-panel :is(.module-archive-heading-actions, .module-archive-actions) select {
  appearance: none !important;
  -webkit-appearance: none !important;
  padding-right: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3.5 5.25 7 8.75l3.5-3.5' stroke='%23425555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px 14px !important;
}

html body .lead-template-builder-dialog :is(
  .lead-template-builder-editor input:not([type="checkbox"]):not([type="radio"]),
  .lead-template-builder-editor select,
  .lead-template-variable-main-button,
  .lead-template-builder-editor button.compact-button,
  .lead-template-builder-footer > button,
  .lead-template-rich-toolbar button,
  .lead-template-rich-color
) {
  box-sizing: border-box !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 4px !important;
  font-size: 13px !important;
  line-height: 18px !important;
}

html body .lead-template-builder-dialog .lead-template-rich-toolbar :is(button, .lead-template-rich-color) {
  flex: 0 0 32px !important;
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  padding: 0 !important;
}

html body .lead-template-builder-dialog .lead-template-builder-editor button.compact-button {
  padding: 0 10px !important;
}

/* Use the shared soft palette instead of the legacy modal button tint. */
html body .lead-template-builder-dialog:not(#control-standard-specificity) :is(.lead-template-rich-toolbar button, .lead-template-variable-help-button, .lead-template-builder-steps button):not(:disabled) {
  background: #fff !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

html body .lead-template-builder-dialog:not(#control-standard-specificity) :is(.lead-template-rich-toolbar button, .lead-template-variable-help-button, .lead-template-builder-steps button):not(:disabled):hover {
  background: var(--brand-hover) !important;
}

html body .lead-template-builder-dialog:not(#control-standard-specificity) .lead-template-builder-steps button.is-active:not(:disabled) {
  background: var(--brand-selected) !important;
  color: var(--brand-accent) !important;
  font-weight: 600 !important;
}

/* The help icon is part of this compound control, not an overlay on its label. */
html body .lead-template-builder-dialog .lead-template-variable-main-button {
  padding: 0 40px 0 10px !important;
}

html body .lead-template-builder-dialog .lead-template-variable-help-button {
  top: 0;
  right: 0;
}
