﻿#screen-crm-config {
  --brand-blue: var(--primary);
  --brand-blue-dark: var(--primary-dark);
  --brand-bg: #f0f4f8;
  --text-dark: #2b3442;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

#screen-crm-config.container.screen {
  max-width: 76%;
}

#screen-crm-config .crm-config-page {
  margin-top: 15px;
}

#screen-crm-config .page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  gap: 12px;
}

#screen-crm-config .crm-config-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

#screen-crm-config .crm-config-actions button {
  white-space: nowrap;
}

#btnIncomingLeadCreateToken,
#btnIncomingLeadCopyWebhook {
  margin-top: 15px;
  font-size: 16px;
}

#btnIncomingLeadCreateToken {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

#business-settings-maskyoo-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin-bottom: 0;
}

#business-settings-maskyoo-panel > .config-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding-top: 18px;
}

#screen-crm-config .form-tab-panel[data-business-settings-panel="general"] > .config-card,
#screen-crm-config .form-tab-panel[data-business-settings-panel="incoming-leads"] > .config-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

#businessSettingsMaskyooSummary {
  width: min(50%, 100%);
  max-width: min(50%, 100%);
  margin-bottom: 16px;
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.7;
}

#businessSettingsMaskyooSummary p {
  margin: 0 0 4px;
}

#business-settings-form,
#business-settings-maskyoo-form,
#business-settings-incoming-leads-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#business-settings-form {
  width: min(50%, 100%);
  max-width: min(50%, 100%);
}

#business-settings-maskyoo-form,
#business-settings-maskyoo-panel > .config-card > div:has(#btn-business-settings-maskyoo-save),
#businessSettingsMaskyooList {
  width: min(50%, 100%);
  max-width: min(50%, 100%);
}

#businessSettingsMaskyooList > p {
  font-size: 14px;
}

#business-settings-form .field,
#business-settings-maskyoo-form .field,
#business-settings-incoming-leads-form .field,
#incomingLeadLatestTokenPanel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

#business-settings-form .field .label,
#business-settings-form .field label,
#business-settings-maskyoo-form .field .label,
#business-settings-maskyoo-form .field label,
#business-settings-incoming-leads-form .field .label,
#business-settings-incoming-leads-form .field label,
#incomingLeadLatestTokenPanel .label,
#incomingLeadLatestTokenPanel label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 0;
  color: var(--text-dark);
}

#business-settings-maskyoo-form .field .label,
#business-settings-maskyoo-form .field label {
  background: transparent !important;
  box-shadow: none;
}

#business-settings-form .field input,
#business-settings-form .field select,
#business-settings-maskyoo-form .field input,
#business-settings-maskyoo-form .field select,
#business-settings-incoming-leads-form .field input,
#business-settings-incoming-leads-form .field select,
#business-settings-incoming-leads-form .field textarea,
#incomingLeadLatestTokenPanel textarea {
  width: 100% !important;
  max-width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.35;
}

#business-settings-maskyoo-form .field input::placeholder {
  font-size: 14px;
}

#business-settings-maskyoo-panel > .config-card > div:has(#btn-business-settings-maskyoo-save) {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

#btn-business-settings-maskyoo-save,
#btn-business-settings-maskyoo-reset {
  min-height: 40px;
  padding: 10px 18px;
  font-size: 15px;
}

#btn-business-settings-maskyoo-save {
  background: var(--white);
  color: var(--brand-blue);
  border: 1px solid var(--border-soft);
}

#businessSettingsMaskyooList {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.6;
}

#business-settings-form .field input::placeholder {
  font-size: 14px;
}

#business-settings-incoming-leads-panel .config-card {
  max-width: none;
}

#business-settings-incoming-leads-form .field input,
#business-settings-incoming-leads-form .field select,
#business-settings-incoming-leads-form .field textarea,
#incomingLeadLatestTokenPanel textarea,
#business-settings-maskyoo-panel > .config-card > div:has(#btn-business-settings-maskyoo-save) {
  width: 100%;
}

#business-settings-incoming-leads-form,
#incomingLeadLatestTokenPanel,
#business-settings-incoming-leads-panel .crm-config-actions {
  width: min(50%, 100%);
  max-width: min(50%, 100%);
}

#incomingLeadTokensList,
#incomingLeadRecentDeliveries {
  width: 100%;
  max-width: none;
}

#incomingLeadRecentDeliveries {
  margin-top: 20px;
}

#business-settings-maskyoo-panel > .config-card > div:has(#btn-business-settings-maskyoo-save) {
  width: min(50%, 100%);
}

#incomingLeadWebhookUrl {
  min-height: 42px;
  height: 42px;
  resize: none;
}

#business-settings-form .field input,
#business-settings-form .field select,
#business-settings-maskyoo-form .field input,
#business-settings-maskyoo-form .field select,
#business-settings-incoming-leads-form .field input,
#business-settings-incoming-leads-form .field select,
#business-settings-incoming-leads-form .field textarea,
#incomingLeadLatestTokenPanel textarea {
  border: 1px solid var(--border-soft);
  background: #f8fafc;
  color: var(--text-dark);
  box-sizing: border-box;
  transition: 0.2s;
}

#business-settings-form .field select,
#business-settings-maskyoo-form .field select,
#business-settings-incoming-leads-form .field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%232b3442' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px 16px;
  background-position: left 12px center;
  padding-left: 38px;
}

#business-settings-form .field input:focus,
#business-settings-form .field select:focus,
#business-settings-maskyoo-form .field input:focus,
#business-settings-maskyoo-form .field select:focus,
#business-settings-incoming-leads-form .field input:focus,
#business-settings-incoming-leads-form .field select:focus,
#business-settings-incoming-leads-form .field textarea:focus,
#incomingLeadLatestTokenPanel textarea:focus {
  background: var(--white);
  border-color: var(--primary);
  box-shadow: none;
  outline: none;
}

#business-settings-form .field select:focus,
#business-settings-maskyoo-form .field select:focus,
#business-settings-incoming-leads-form .field select:focus,
#business-settings-form .field select:active,
#business-settings-maskyoo-form .field select:active,
#business-settings-incoming-leads-form .field select:active {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%232b3442' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px 16px;
  background-position: left 12px center;
}

#business-settings-form .field input::placeholder,
#business-settings-maskyoo-form .field input::placeholder,
#business-settings-incoming-leads-form .field input::placeholder,
#business-settings-incoming-leads-form .field textarea::placeholder,
#incomingLeadLatestTokenPanel textarea::placeholder {
  color: var(--text-muted);
}

#business-settings-incoming-leads-panel > .config-card > .crm-config-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

#screen-crm-config .incoming-leads-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
}

#incomingLeadTokensList .section-title {
  font-size: 15px;
}

#incomingLeadTokensList {
  margin-top: 35px;
}

#btnIncomingLeadToggleJsonExample {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  width: auto;
  max-width: max-content;
  height: 36px;
  margin-top: 0;
  margin-inline-start: auto;
  padding: 0 18px;
  font-size: 16px;
  line-height: 1.2;
}

#incomingLeadTokensList > p,
#incomingLeadRecentDeliveries > p {
  font-size: 15px;
  margin-top: 20px;
}

#screen-crm-config .incoming-leads-table {
  min-width: 980px;
}

#screen-crm-config .incoming-leads-table thead th {
  color: var(--text-muted);
}

#screen-crm-config .incoming-leads-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 6px;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: inherit;
  text-align: center;
  cursor: pointer;
}

#screen-crm-config .incoming-leads-sort-btn .sort-icon {
  order: -1;
  transition: opacity 0.16s ease, color 0.16s ease;
}

#screen-crm-config .incoming-leads-sort-btn .sort-icon svg {
  transition: transform 0.16s ease;
}

#screen-crm-config .incoming-leads-sort-btn.is-active {
  color: var(--text-muted);
}

#screen-crm-config .incoming-leads-sort-btn.is-active .sort-icon {
  opacity: 1;
  color: var(--text-muted);
}

#screen-crm-config .incoming-leads-sort-btn[data-sort-dir="asc"] .sort-icon svg {
  transform: rotate(180deg);
}

#screen-crm-config .incoming-leads-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

#screen-crm-config .incoming-leads-status-badge.is-active,
#screen-crm-config .incoming-leads-status-badge.is-success {
  background: #ecfdf5;
  color: #166534;
}

#screen-crm-config .incoming-leads-status-badge.is-revoked,
#screen-crm-config .incoming-leads-status-badge.is-danger {
  background: #fef2f2;
  color: #b91c1c;
}

#screen-crm-config .incoming-leads-status-badge.is-warning {
  background: #fffbeb;
  color: #b45309;
}

#screen-crm-config .incoming-leads-status-badge.is-info {
  background: #eff6ff;
  color: #1d4ed8;
}

#screen-crm-config .incoming-leads-status-badge.is-muted {
  background: #f8fafc;
  color: #475569;
}

#screen-crm-config .incoming-leads-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#screen-crm-config .incoming-leads-actions-cell .btn,
#screen-crm-config .incoming-leads-deliveries-table .btn {
  min-width: 0;
  font-size: 13px;
}

#screen-crm-config .incoming-leads-revoke-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding-inline: 10px;
}

#screen-crm-config .incoming-leads-revoke-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

#screen-crm-config .incoming-leads-user-agent-cell,
#screen-crm-config .incoming-leads-message-cell {
  max-width: 260px;
  white-space: normal;
  word-break: break-word;
}

#screen-crm-config .incoming-leads-muted {
  color: var(--text-muted);
}

#screen-crm-config .incoming-leads-payload-viewer {
  margin-top: 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

#screen-crm-config .incoming-leads-payload-viewer [data-delivery-action="close-payload"] {
  font-size: 14px;
}

#screen-crm-config .incoming-leads-payload-textarea {
  min-height: 220px;
  direction: ltr;
  text-align: left;
  margin-top: 12px;
}

#screen-crm-config .header-title-group {
  background: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

#screen-crm-config .crm-config-icon {
  color: var(--brand-blue);
}

#screen-crm-config .page-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--brand-blue);
  margin: 0;
}

#screen-crm-config .btn-save {
  background: var(--brand-blue);
  color: #fff;
  border: 0;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s ease;
  box-shadow: 0 4px 15px rgba(30, 78, 132, 0.2);
  min-height: 40px;
  white-space: nowrap;
  position: relative;
  isolation: isolate;
}

#screen-crm-config .btn-save.has-pending-changes::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 14px;
  box-shadow: 0 0 0 0 rgba(30, 78, 132, 0.28);
  pointer-events: none;
  animation: crmConfigSaveHalo 1.8s ease-out infinite;
}

#screen-crm-config .crm-config-actions > .btn-save {
  margin-top: 10px;
}

#screen-crm-config .btn-save:hover {
  background: var(--brand-blue-dark);
  transform: translateY(-1px);
}

@keyframes crmConfigSaveHalo {
  0% {
    box-shadow: 0 0 0 0 rgba(30, 78, 132, 0.28);
    opacity: 0.95;
  }

  70% {
    box-shadow: 0 0 0 10px rgba(30, 78, 132, 0);
    opacity: 0;
  }

  100% {
    box-shadow: 0 0 0 0 rgba(30, 78, 132, 0);
    opacity: 0;
  }
}

#screen-crm-config .btn.btn-secondary {
  background: #fff;
  color: var(--brand-blue);
  border: 1px solid rgba(30, 78, 132, 0.18);
}

#screen-crm-config #btn-config-toggle-inactive.btn {
  padding: 0.35rem 0.35rem;
  min-height: 32px;
  font-size: clamp(10px, 1.6vw, 12px);
  line-height: 1.2;
  border-radius: 8px;
}

#screen-crm-config .settings-nav {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
  margin-bottom: 18px;
  scrollbar-width: none;
}

#screen-crm-config .crm-config-tab-overflow-hidden {
  display: none;
}

#screen-crm-config .crm-config-tabs-overflow-toggle {
  flex: 0 0 auto;
}

#crm-config-tabs-overflow-panel {
  display: none;
  flex-direction: column;
  gap: 6px;
  position: absolute;
  top: 0;
  left: 0;
  width: 180px;
  max-width: calc(100vw - 24px);
  padding: 8px;
  background: var(--white);
  border: 1px solid rgba(30, 78, 132, 0.12);
  border-radius: 28px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
  z-index: 1200;
}

#crm-config-tabs-overflow-panel.is-open {
  display: flex;
}

#crm-config-tabs-overflow-panel .crm-config-tabs-overflow-item {
  width: 100%;
  text-align: right;
  background: var(--white);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid transparent;
  outline: none;
  appearance: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

#crm-config-tabs-overflow-panel .crm-config-tabs-overflow-item.active {
  background: var(--brand-blue);
  color: #fff;
  box-shadow: 0 4px 10px rgba(30, 78, 132, 0.2);
}

#crm-config-tabs-overflow-panel .crm-config-tabs-overflow-item:hover {
  background: var(--brand-blue);
}

#screen-crm-config .settings-nav::-webkit-scrollbar {
  display: none;
}

#screen-crm-config .nav-tab {
  background: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

#screen-crm-config .nav-tab.active {
  background: var(--brand-blue);
  color: #fff;
  box-shadow: 0 4px 10px rgba(30, 78, 132, 0.2);
}

#screen-crm-config .settings-content {
  display: none;
  animation: crmConfigFadeIn 0.3s ease-out;
}

#screen-crm-config .settings-content.active {
  display: block;
}

#screen-crm-config .form-tab-panel {
  display: none;
}

#screen-crm-config .form-tab-panel.active {
  display: block;
}

@keyframes crmConfigFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#screen-crm-config .config-card,
#screen-crm-config .cfg-status-section,
#screen-crm-config .cfg-section-block {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid #fff;
  margin-bottom: 18px;
}

#screen-crm-config .card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  gap: 10px;
}

#screen-crm-config .section-title,
#screen-crm-config .cfg-status-section > h3,
#screen-crm-config .cfg-section-block > h3 {
  font-size: 17px;
  font-weight: 900;
  color: var(--brand-blue);
  margin: 0;
}

#screen-crm-config .btn-add-item,
#screen-crm-config .add-row,
#screen-crm-config .add-status,
#screen-crm-config .cfg-field-add-btn,
#screen-crm-config .cfg-field-option-add-btn {
  background: #f0f9ff;
  color: var(--brand-blue);
  border: 1px solid #bae6fd;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin-top: 0;
}

#screen-crm-config .crm-config-fields-table + .cfg-field-add-btn {
  display: inline-flex;
  margin-top: 12px;
}

#screen-crm-config .btn-add-item:hover,
#screen-crm-config .add-row:hover,
#screen-crm-config .add-status:hover,
#screen-crm-config .cfg-field-add-btn:hover,
#screen-crm-config .cfg-field-option-add-btn:hover {
  background: #e0f2fe;
}

#screen-crm-config .config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #f8fafc;
  transition: 0.2s ease;
  border-radius: 10px;
  gap: 12px;
}

#screen-crm-config .config-row:hover {
  background: #f8fafc;
}

#screen-crm-config .config-row:last-child {
  border-bottom: none;
}

#screen-crm-config .row-start {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

#screen-crm-config .row-end {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

#screen-crm-config .item-name,
#screen-crm-config .input-mini {
  font-weight: 600;
  font-size: 14px;
}

#screen-crm-config .input-mini {
  border: 1px solid var(--border-color);
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 10px;
  width: min(520px, 100%);
}

#screen-crm-config .form-group {
  margin-bottom: 18px;
}

#screen-crm-config .form-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-dark);
}

#screen-crm-config .switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

#screen-crm-config .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

#screen-crm-config .switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.2s ease;
  border-radius: 999px;
}

#screen-crm-config .switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  right: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.2s ease;
  border-radius: 999px;
}

#screen-crm-config .switch input:checked + .slider {
  background-color: var(--brand-blue);
}

#screen-crm-config .switch input.cfg-field-mandatory-input:checked + .slider {
  background-color: var(--red);
}

#screen-crm-config .switch input:checked + .slider:before {
  transform: translateX(-20px);
}

#screen-crm-config .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: #cbd5e1;
}

#screen-crm-config .icon-btn:hover {
  background: #fff1f2;
  border-color: rgba(239, 68, 68, 0.25);
  color: #b91c1c;
}

#screen-crm-config .cfg-table,
#screen-crm-config .cfg-statuses-table,
#screen-crm-config .cfg-fields-table,
#screen-crm-config .cfg-order-fields-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

#screen-crm-config .cfg-statuses-table {
  overflow: visible;
}

#screen-crm-config .cfg-table thead th,
#screen-crm-config .cfg-statuses-table thead th,
#screen-crm-config .cfg-fields-table thead th,
#screen-crm-config .cfg-order-fields-table thead th {
  background: var(--lightblue);
  color: var(--black);
  font-weight: 800;
  font-size: 13px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
}

#screen-crm-config .crm-config-fields-table[data-section="event_card"] thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--lightblue);
}

#screen-crm-config .crm-config-fields-table[data-section="event_card"] {
  border-collapse: separate;
  border-spacing: 0;
  overflow: visible;
}

#screen-crm-config .cfg-table td,
#screen-crm-config .cfg-statuses-table td,
#screen-crm-config .cfg-fields-table td,
#screen-crm-config .cfg-order-fields-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f8fafc;
  font-size: 14px;
  vertical-align: middle;
}

.crm-config-fields-table th.custom-field-actions-col,
.crm-config-fields-table td.custom-field-actions-col {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
  text-align: center;
  white-space: nowrap;
}

.crm-config-fields-table td.custom-field-actions-col > * {
  margin-left: auto;
  margin-right: auto;
}

#screen-crm-config .cfg-table tr:last-child td,
#screen-crm-config .cfg-statuses-table tr:last-child td,
#screen-crm-config .cfg-fields-table tr:last-child td,
#screen-crm-config .cfg-order-fields-table tr:last-child td {
  border-bottom: none;
}

#screen-crm-config .cfg-table input[type="text"],
#screen-crm-config .cfg-table input[type="number"],
#screen-crm-config .cfg-table select,
#screen-crm-config .cfg-statuses-table input[type="text"],
#screen-crm-config .cfg-statuses-table input[type="number"],
#screen-crm-config .cfg-statuses-table select,
#screen-crm-config .cfg-fields-table input[type="text"],
#screen-crm-config .cfg-fields-table input[type="number"],
#screen-crm-config .cfg-fields-table select,
#screen-crm-config .cfg-order-fields-table input[type="text"],
#screen-crm-config .cfg-order-fields-table input[type="number"] {
  border: 1px solid var(--border-color);
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
}

#screen-crm-config .cfg-field-placement-select {
  direction: rtl;
  text-align: right;
  text-align-last: right;
  padding-right: 10px;
  padding-left: 34px;
}

#screen-crm-config .cfg-color-btn {
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

#screen-crm-config .cfg-color-swatch.cfg-color-swatch-used {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: auto;
  position: relative;
}

#screen-crm-config .crm-config-forms-shell {
  position: relative;
}

#screen-crm-config .crm-config-forms-subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

#screen-crm-config .crm-config-forms-state,
#screen-crm-config .crm-config-forms-empty-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#screen-crm-config .crm-config-forms-empty-state p {
  margin: 8px 0 0;
  color: var(--text-muted);
}

#screen-crm-config .crm-config-forms-header-actions,
#screen-crm-config .crm-config-forms-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#screen-crm-config .crm-config-forms-row-actions .icon-btn[data-action="toggle-template"][data-template-active="1"] {
  color: #15803d;
  background: transparent;
  border-color: transparent;
  width: 64px;
  height: 44px;
}

#screen-crm-config .crm-config-forms-row-actions .icon-btn[data-action="toggle-template"][data-template-active="0"] {
  color: #b91c1c;
  background: transparent;
  border-color: transparent;
  width: 64px;
  height: 44px;
}

#screen-crm-config .crm-config-forms-row-actions .icon-btn[data-action="toggle-template"] {
  border: 0;
  box-shadow: none;
}

#screen-crm-config .crm-config-forms-row-actions .icon-btn[data-action="toggle-template"] i {
  font-size: 1.3em;
}

#screen-crm-config .crm-config-forms-row-actions .icon-btn[data-action="toggle-template"]:hover {
  background: transparent;
  border-color: transparent;
}

#screen-crm-config .crm-config-forms-table-wrap {
  overflow-x: auto;
}

#screen-crm-config .crm-config-forms-table th,
#screen-crm-config .crm-config-forms-table td {
  text-align: center;
}

#screen-crm-config .crm-config-forms-table th {
  font-size: 9px;
  text-align: center;
  vertical-align: middle;
}

#screen-crm-config .crm-config-forms-table-sort-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: row-reverse;
  gap: 6px;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--table-sort-icon-color);
  font: inherit;
  font-weight: inherit;
  text-align: center;
  cursor: pointer;
}

#screen-crm-config .crm-config-forms-table-sort-btn > span:first-child {
  color: var(--text-muted);
}

#screen-crm-config .crm-config-forms-table-sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  opacity: 0.65;
}

#screen-crm-config .crm-config-forms-table-sort-icon svg {
  width: 16px;
  height: 16px;
}

#screen-crm-config .crm-config-forms-table-sort-btn.is-active .crm-config-forms-table-sort-icon {
  opacity: 1;
}

#screen-crm-config .crm-config-forms-table-sort-icon.is-asc {
  transform: rotate(180deg);
}

#screen-crm-config .crm-config-forms-table .crm-config-forms-row-actions {
  justify-content: center;
}

#screen-crm-config .crm-config-forms-table th:last-child,
#screen-crm-config .crm-config-forms-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

#screen-crm-config .crm-config-forms-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(15, 23, 42, 0.62);
  padding: 20px;
  overflow-y: auto;
}

#screen-crm-config .crm-config-forms-editor-shell {
  min-height: calc(100vh - 40px);
  width: min(100%, 1520px);
  margin-inline: auto;
  background: #e8eef5;
  border-radius: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#screen-crm-config .crm-config-forms-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

#screen-crm-config .crm-config-forms-editor-title-group h2 {
  margin: 0;
  color: var(--brand-blue);
  font-size: 24px;
}

#screen-crm-config .crm-config-forms-editor-title-group p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

#screen-crm-config .crm-config-forms-editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#screen-crm-config .crm-config-forms-preview-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(13px, 2.5vw, 16px);
}

#screen-crm-config .crm-config-forms-preview-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

#screen-crm-config .crm-config-forms-editor-meta.is-hidden,
#screen-crm-config .crm-config-forms-sidebar.is-hidden {
  display: none;
}

#screen-crm-config .crm-config-forms-editor-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

#screen-crm-config .crm-config-forms-editor-body {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

#screen-crm-config .crm-config-form-builder {
  grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
  grid-template-areas: "canvas sidebar";
  width: 100%;
  min-width: 0;
}

#screen-crm-config .crm-config-form-builder.is-client-preview {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "canvas";
}

#screen-crm-config .crm-config-forms-editor-body.is-loading {
  opacity: 0.68;
  pointer-events: none;
}

#screen-crm-config .crm-config-forms-sidebar,
#screen-crm-config .crm-config-forms-canvas-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

#screen-crm-config .crm-config-form-builder .crm-config-forms-sidebar {
  grid-area: sidebar;
}

#screen-crm-config .crm-config-form-builder .crm-config-forms-canvas-wrap {
  grid-area: canvas;
}

#screen-crm-config .crm-config-forms-editor-shell.is-client-preview {
  max-width: 980px;
}

#screen-crm-config .crm-config-forms-bank-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#screen-crm-config .crm-config-forms-bank-item {
  width: 100%;
  border: 1px dashed #cbd5e1;
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: right;
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--brand-blue);
  font-weight: 800;
}

#screen-crm-config .crm-config-forms-bank-item small {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

#screen-crm-config .crm-config-forms-dropzone {
  min-height: 320px;
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#screen-crm-config .crm-config-forms-live-canvas {
  width: min(100%, 794px);
  min-height: 1123px;
  margin: 0 auto;
  padding: 32px 28px;
  background: #fff;
  border: 0;
  border-radius: 6px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

#screen-crm-config .crm-config-forms-client-preview-card {
  padding: 28px;
  background: #eef1f4;
  border: 0;
  border-radius: 18px;
}

#screen-crm-config .crm-config-forms-client-preview-shell,
#screen-crm-config .crm-config-forms-client-preview-paper,
#screen-crm-config .crm-config-forms-client-preview-form,
#screen-crm-config .crm-config-forms-client-preview-header,
#screen-crm-config .crm-config-forms-client-preview-hero,
#screen-crm-config .crm-config-forms-signature-section,
#screen-crm-config .crm-config-forms-signature-section-header {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#screen-crm-config .crm-config-forms-client-preview-paper {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 38px 42px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
  border: 1px solid #dbeafe;
}

#screen-crm-config .crm-config-forms-client-preview-kicker {
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

#screen-crm-config .crm-config-forms-client-preview-header {
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

#screen-crm-config .crm-config-forms-client-preview-header h3 {
  margin: 0;
  color: var(--brand-blue);
  font-size: 34px;
  line-height: 1.15;
}

#screen-crm-config .crm-config-forms-client-preview-header p,
#screen-crm-config .crm-config-forms-client-preview-intro p,
#screen-crm-config .crm-config-forms-client-preview-empty,
#screen-crm-config .crm-config-forms-preview-label small,
#screen-crm-config .crm-config-forms-preview-heading-block p,
#screen-crm-config .crm-config-forms-signature-placeholder span {
  margin: 0;
  color: var(--text-muted);
}

#screen-crm-config .crm-config-forms-client-preview-intro {
  padding: 0 0 4px;
}

#screen-crm-config .crm-config-forms-client-preview-body,
#screen-crm-config .crm-config-forms-signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  align-items: start;
}

#screen-crm-config .crm-config-forms-preview-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

#screen-crm-config .crm-config-forms-preview-field.is-half {
  grid-column: span 1;
}

#screen-crm-config .crm-config-forms-preview-field.is-full,
#screen-crm-config .crm-config-forms-preview-field.is-heading,
#screen-crm-config .crm-config-forms-signature-section {
  grid-column: 1 / -1;
}

#screen-crm-config .crm-config-forms-preview-field.is-heading {
  padding: 10px 0 2px;
}

#screen-crm-config .crm-config-forms-preview-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #0f172a;
  font-weight: 800;
}

#screen-crm-config .crm-config-forms-preview-heading-block h4 {
  margin: 0;
  color: var(--brand-blue);
  font-size: 24px;
}

#screen-crm-config .crm-config-forms-preview-heading-block {
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

#screen-crm-config .crm-config-forms-preview-body {
  min-width: 0;
}

#screen-crm-config .crm-config-forms-signature-section {
  margin-top: 8px;
  padding-top: 20px;
  font-size: 13px;
}

#screen-crm-config .crm-config-forms-signature-section-header h4 {
  margin: 0;
  color: var(--brand-blue);
  font-size: 14px;
}

#screen-crm-config .crm-config-forms-signature-contract-rows {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#screen-crm-config .crm-config-forms-signature-contract-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

#screen-crm-config .crm-config-forms-signature-contract-field {
  display: inline-flex;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
  color: #0f172a;
  font-weight: 500;
}

#screen-crm-config .crm-config-forms-signature-contract-field.is-date {
  flex: 0 1 34%;
}

#screen-crm-config .crm-config-forms-signature-contract-field.is-signature {
  flex: 1 1 50%;
}

#screen-crm-config .crm-config-forms-signature-contract-field span {
  white-space: nowrap;
}

#screen-crm-config .crm-config-forms-signature-contract-line {
  flex: 1 1 auto;
  min-width: 120px;
  height: 0;
  border-top: 2px solid #111827;
}

#screen-crm-config .crm-config-forms-live-field {
  position: relative;
  border: 0;
  border-radius: 0;
  padding: 10px;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

#screen-crm-config .crm-config-forms-live-field.is-selected {
  border-color: transparent;
  box-shadow: none;
}

#screen-crm-config .crm-config-forms-live-field:focus-within {
  border-color: transparent;
  box-shadow: none;
}

#screen-crm-config .crm-config-forms-live-field.is-heading {
  background: transparent;
}

#screen-crm-config .crm-config-forms-live-field-topbar,
#screen-crm-config .crm-config-forms-live-field-meta,
#screen-crm-config .crm-config-forms-live-actions,
#screen-crm-config .crm-config-forms-live-choice-pair {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#screen-crm-config .crm-config-forms-live-field-topbar.is-hidden {
  display: none;
}

#screen-crm-config .crm-config-forms-live-field-topbar {
  justify-content: flex-start;
}

#screen-crm-config .crm-config-forms-live-field-meta {
  justify-content: flex-start;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

#screen-crm-config .crm-config-forms-live-actions {
  justify-content: flex-start;
  margin-right: auto;
}

#screen-crm-config .crm-config-forms-live-actions .icon-btn {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  font-size: 0.72rem;
}

#screen-crm-config .crm-config-forms-live-choice-pair {
  justify-content: flex-start;
  width: auto;
}

#screen-crm-config .crm-config-forms-live-editor {
  border-top: 1px solid #dbeafe;
  margin-top: 4px;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#screen-crm-config .crm-config-forms-live-editor-header,
#screen-crm-config .crm-config-forms-live-editor-actions,
#screen-crm-config .crm-config-forms-option-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#screen-crm-config .crm-config-forms-live-editor-header {
  justify-content: space-between;
}

#screen-crm-config .crm-config-forms-live-editor-header h4,
#screen-crm-config .crm-config-forms-settings-heading-row h4 {
  margin: 0;
  color: var(--brand-blue);
  font-size: 14px;
}

#screen-crm-config .crm-config-forms-live-editor-grid {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
}

#screen-crm-config .crm-config-forms-live-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #0f172a;
  font-weight: 400;
}

#screen-crm-config .crm-config-forms-live-title-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #0f172a;
  font-size: 16px;
  font-weight: 400;
  padding: 0 8px 4px 0;
  outline: 0;
}

#screen-crm-config .crm-config-forms-live-title-input.is-heading {
  color: var(--brand-blue);
  font-size: 20px;
}

#screen-crm-config .crm-config-forms-live-title-input:focus {
  border-bottom-color: var(--brand-blue);
}

#screen-crm-config .crm-config-forms-live-title-input::placeholder {
  color: var(--text-muted);
}

#screen-crm-config .crm-config-forms-live-label small,
#screen-crm-config .crm-config-forms-live-heading-block p,
#screen-crm-config .crm-config-forms-live-empty-options {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

#screen-crm-config .crm-config-forms-live-field-body {
  min-width: 0;
}

#screen-crm-config .crm-config-forms-live-control {
  width: 100%;
  border-radius: 0;
  font-size: 16px;
  pointer-events: none;
}

#screen-crm-config .crm-config-forms-live-control[disabled] {
  opacity: 1;
  color: #0f172a;
  -webkit-text-fill-color: #0f172a;
}

#screen-crm-config .crm-config-forms-live-textarea {
  min-height: 110px;
}

#screen-crm-config .crm-config-forms-live-checkbox-group,
#screen-crm-config .crm-config-forms-live-heading-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#screen-crm-config .crm-config-forms-live-heading-block h4 {
  margin: 0;
  color: var(--brand-blue);
  font-size: 20px;
}

#screen-crm-config .crm-config-forms-live-heading-block p {
  margin: 0;
}

#screen-crm-config .crm-config-forms-live-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
}

#screen-crm-config .crm-config-forms-live-check.option {
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
}

#screen-crm-config .crm-config-forms-live-canvas.is-client-preview .crm-config-forms-live-field {
  border-color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.03);
}

#screen-crm-config .crm-config-forms-live-canvas.is-client-preview .crm-config-forms-live-field.is-selected {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.03);
}

#screen-crm-config .crm-config-forms-dropzone-empty {
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
}

#screen-crm-config .crm-config-forms-settings-card.is-passive {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

#screen-crm-config .crm-config-forms-settings-heading-row,
#screen-crm-config .crm-config-forms-settings-heading-row,
#screen-crm-config .crm-config-forms-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#screen-crm-config .crm-config-forms-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#screen-crm-config .crm-config-forms-settings-block,
#screen-crm-config .crm-config-forms-settings-empty {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#screen-crm-config .crm-config-forms-settings-empty {
  color: var(--text-muted);
}

#screen-crm-config .crm-config-forms-textarea {
  min-height: 100px;
  resize: vertical;
}

#screen-crm-config .crm-config-forms-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#screen-crm-config .crm-config-forms-option-row .input {
  flex: 1 1 auto;
}

#screen-crm-config .crm-config-forms-option-actions {
  justify-content: flex-end;
  flex: 0 0 auto;
}

#screen-crm-config .crm-config-forms-live-editor .crm-config-forms-settings-heading-row {
  justify-content: flex-start;
}

#screen-crm-config .crm-config-forms-toggle-field {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#screen-crm-config .crm-config-forms-editor-shell {
  max-width: 1520px;
}

#screen-crm-config .crm-config-forms-editor-body {
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  align-items: stretch;
}

#screen-crm-config .crm-config-form-builder {
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  grid-template-areas: "sidebar canvas";
}

#screen-crm-config .crm-config-forms-sidebar {
  gap: 14px;
}

#screen-crm-config .crm-config-forms-sidebar-card {
  background: #fff;
}

#screen-crm-config .crm-config-forms-palette-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#screen-crm-config .crm-config-forms-palette-item {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: right;
  color: var(--brand-blue);
  font-size: 16px;
  font-weight: 800;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#screen-crm-config .crm-config-forms-template-settings-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#screen-crm-config .crm-config-forms-template-setting-row,
#screen-crm-config .crm-config-forms-manager-card-top,
#screen-crm-config .crm-config-forms-manager-actions,
#screen-crm-config .crm-config-forms-manager-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#screen-crm-config .crm-config-forms-template-setting-row {
  padding: 10px 0;
  border-top: 1px solid #eef2ff;
}

#screen-crm-config .crm-config-forms-template-setting-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

#screen-crm-config .crm-config-forms-manager-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#screen-crm-config .crm-config-forms-field-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#screen-crm-config .crm-config-forms-field-settings-full {
  grid-column: 1 / -1;
}

#screen-crm-config .crm-config-forms-manager-card {
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#screen-crm-config .crm-config-forms-manager-card.is-selected {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

#screen-crm-config .crm-config-forms-manager-type {
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 800;
  background: #eff6ff;
  border-radius: 999px;
  padding: 4px 10px;
}

#screen-crm-config .crm-config-forms-manager-textarea {
  min-height: 90px;
}

#screen-crm-config .crm-config-forms-manager-toggle-row {
  margin-top: -2px;
}

#screen-crm-config .crm-config-forms-manager-options-block {
  padding-top: 6px;
}

#screen-crm-config .crm-config-forms-canvas-wrap {
  min-width: 0;
}

#screen-crm-config .crm-config-forms-live-stage {
  min-height: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#screen-crm-config .crm-config-forms-live-stage.is-clean-preview {
  border: 0;
  padding: 0;
  background: transparent;
}

#screen-crm-config .crm-config-forms-live-stage-header.is-hidden {
  display: none;
}

#screen-crm-config .crm-config-forms-client-preview-card {
  padding: 0;
  background: transparent;
}

#screen-crm-config .crm-config-forms-client-preview-paper {
  width: min(100%, 880px);
  font-size: var(--crm-form-font-size, 16px);
}

#screen-crm-config .crm-config-forms-client-preview-paper .input,
#screen-crm-config .crm-config-forms-client-preview-paper select,
#screen-crm-config .crm-config-forms-client-preview-paper textarea,
#screen-crm-config .crm-config-forms-client-preview-paper label,
#screen-crm-config .crm-config-forms-client-preview-paper p,
#screen-crm-config .crm-config-forms-client-preview-paper span,
#screen-crm-config .crm-config-forms-client-preview-paper small {
  font-size: inherit;
}

#screen-crm-config .crm-config-forms-document-title-input,
#screen-crm-config .crm-config-forms-document-description-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #0f172a;
  outline: 0;
  resize: none;
}

#screen-crm-config .crm-config-forms-document-title-input {
  font-size: 2.125rem;
  line-height: 1.15;
  font-weight: 800;
  padding: 0;
}

#screen-crm-config .crm-config-forms-document-description-input {
  min-height: 56px;
  font-size: 15px;
  line-height: 1.8;
  padding: 0;
  color: var(--text-muted);
}

#screen-crm-config .crm-config-forms-document-title-input::placeholder,
#screen-crm-config .crm-config-forms-document-description-input::placeholder {
  color: var(--text-muted);
}

#screen-crm-config .crm-config-forms-live-control {
  pointer-events: none;
  background: #fff;
}

#screen-crm-config .crm-config-forms-preview-choice-pair {
  justify-content: flex-start;
}

@page {
  size: A4;
  margin: 12mm;
}

@media print {
  body.crm-forms-print-mode {
    background: #fff !important;
  }

  body.crm-forms-print-mode * {
    visibility: hidden !important;
  }

  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-client-preview-card,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-client-preview-card * {
    visibility: visible !important;
  }

  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-editor-overlay {
    position: static !important;
    inset: auto !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-editor-shell,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-client-preview-card,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-client-preview-paper {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-editor-header,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-editor-meta,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-sidebar,
  body.crm-forms-print-mode #screen-crm-config .card-header-row,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-client-preview-kicker,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-client-preview-intro {
    display: none !important;
  }

  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-client-preview-shell,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-client-preview-paper,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-client-preview-form {
    gap: 12px !important;
  }

  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-client-preview-body,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-signature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 16px !important;
  }

  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-preview-field.is-full,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-preview-field.is-heading,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-signature-section {
    grid-column: 1 / -1 !important;
  }

  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-client-preview-header h3,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-preview-heading-block h4,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-signature-section-header h4 {
    color: #000 !important;
  }

  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-live-control,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-signature-contract-row,
  body.crm-forms-print-mode #screen-crm-config .crm-config-forms-signature-contract-line {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Floating save button – desktop only */
@media (min-width: 901px) {
  #screen-crm-config #btn-config-save {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
  }

  #screen-crm-config #btn-config-save:hover {
    transform: translateY(calc(-50% - 1px));
  }

  #screen-crm-config .cfg-order-fields-table {
    table-layout: fixed;
  }

  #screen-crm-config .cfg-order-fields-table .cfg-order-col-qty,
  #screen-crm-config .cfg-order-fields-table .cfg-order-col-price,
  #screen-crm-config .cfg-order-fields-table .cfg-order-col-auto,
  #screen-crm-config .cfg-order-fields-table .cfg-order-col-active,
  #screen-crm-config .cfg-order-fields-table .cfg-order-col-remove {
    width: calc(56% / 5);
  }

  #screen-crm-config .cfg-order-fields-table .cfg-order-col-desc .cfg-order-desc {
    display: block;
    width: 100%;
    min-width: 100%;
  }

  #screen-crm-config .cfg-menu-category-title {
    width: 100%;
    max-width: 240px;
  }

  #screen-crm-config .cfg-manual-menu-topbar {
    align-items: flex-end;
  }

  #screen-crm-config .cfg-manual-menu-topbar > .cfg-manual-menu-actions {
    margin-bottom: 0;
    align-self: flex-end;
  }

  #screen-crm-config .cfg-menu-categories-card .cfg-manual-menu-field-title {
    flex-basis: 300px;
  }

  #screen-crm-config .cfg-menu-categories-card .cfg-manual-menu-actions {
    flex: 0 0 auto;
  }

  #screen-crm-config .btn.btn-secondary.cfg-category-menu-new-btn,
  #screen-crm-config .btn.btn-secondary.cfg-category-menu-duplicate-btn,
  #screen-crm-config .btn.btn-secondary.cfg-category-menu-delete-btn {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    min-width: 0;
    padding: 0 18px;
    gap: 5px;
    background: #f0f9ff;
    color: var(--brand-blue);
    border: 1px solid var(--brand-blue);
  }

  #screen-crm-config .btn.btn-secondary.cfg-category-menu-new-btn svg,
  #screen-crm-config .btn.btn-secondary.cfg-category-menu-duplicate-btn svg {
    width: 17px;
    height: 17px;
    color: var(--brand-blue);
    stroke: var(--brand-blue);
  }

  #screen-crm-config .btn.btn-secondary.cfg-category-menu-new-btn:hover,
  #screen-crm-config .btn.btn-secondary.cfg-category-menu-duplicate-btn:hover {
    background: #f0f9ff;
    color: var(--brand-blue);
    border-color: transparent;
  }

  #screen-crm-config .cfg-menu-table {
    table-layout: fixed;
  }

  #screen-crm-config .cfg-menu-table th:nth-child(1),
  #screen-crm-config .cfg-menu-table td:nth-child(1) {
    width: 18%;
  }
  #screen-crm-config .cfg-menu-table th:nth-child(2),
  #screen-crm-config .cfg-menu-table td:nth-child(2) {
    width: 28%;
  }

  #screen-crm-config .cfg-menu-table th:nth-child(3),
  #screen-crm-config .cfg-menu-table td:nth-child(3) {
    width: 24%;
  }

  #screen-crm-config .cfg-menu-table th:nth-child(4),
  #screen-crm-config .cfg-menu-table td:nth-child(4) {
    width: 14%;
  }

  #screen-crm-config .cfg-menu-table th:nth-child(5),
  #screen-crm-config .cfg-menu-table td:nth-child(5) {
    width: 8%;
  }

  #screen-crm-config .cfg-menu-table th:nth-child(6),
  #screen-crm-config .cfg-menu-table td:nth-child(6) {
    width: 8%;
  }

  #screen-crm-config .cfg-order-fields-table .cfg-order-col-desc {
    width: 44%;
  }
}

@media (max-width: 900px) {
  #screen-crm-config .crm-config-forms-editor-overlay {
    padding: 10px;
  }

  #screen-crm-config .crm-config-forms-editor-shell {
    min-height: calc(100vh - 20px);
    padding: 12px;
  }

  #screen-crm-config .crm-config-forms-editor-header,
  #screen-crm-config .crm-config-forms-empty-state {
    flex-direction: column;
    align-items: stretch;
  }

  #screen-crm-config .crm-config-forms-palette-grid,
  #screen-crm-config .crm-config-forms-field-settings-grid,
  #screen-crm-config .crm-config-forms-editor-meta-grid,
  #screen-crm-config .crm-config-forms-settings-grid,
  #screen-crm-config .crm-config-forms-editor-body,
  #screen-crm-config .crm-config-forms-client-preview-body,
  #screen-crm-config .crm-config-forms-signature-grid {
    grid-template-columns: 1fr;
  }

  #screen-crm-config .crm-config-forms-signature-contract-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  #screen-crm-config .crm-config-forms-signature-contract-field {
    width: 100%;
  }

  #screen-crm-config .crm-config-forms-editor-actions,
  #screen-crm-config .crm-config-forms-header-actions,
  #screen-crm-config .crm-config-forms-row-actions,
  #screen-crm-config .crm-config-forms-live-field-topbar,
  #screen-crm-config .crm-config-forms-live-choice-pair {
    flex-wrap: wrap;
  }

  #screen-crm-config .crm-config-forms-live-stage {
    padding: 12px;
    border-radius: 20px;
  }

  #screen-crm-config .crm-config-forms-live-canvas {
    min-height: auto;
    padding: 18px 14px;
  }

  #screen-crm-config .crm-config-forms-client-preview-paper {
    padding: 22px 18px;
    border-radius: 22px;
  }

  #screen-crm-config .crm-config-form-builder {
    grid-template-areas:
      "sidebar"
      "canvas";
  }

  #screen-crm-config .crm-config-forms-table th,
  #screen-crm-config .crm-config-forms-table td {
    white-space: nowrap;
  }

  #screen-crm-config .crm-config-forms-document-title-input,
  #screen-crm-config .crm-config-forms-client-preview-header h3 {
    font-size: 28px;
  }
}

@media (max-width: 767px) {
  #screen-crm-config.container.screen {
    max-width: 100%;
  }

  #screen-crm-config .header-title-group {
    display: none;
  }

  #screen-crm-config .settings-nav {
    margin-top: 60px;
  }

  #screen-crm-config .crm-config-tabs-overflow-toggle,
  #crm-config-tabs-overflow-panel {
    display: none !important;
  }

  #screen-crm-config .crm-config-tab-overflow-hidden {
    display: inline-flex;
  }

  #business-settings-form {
      display: flex;
      gap: 1rem;
      flex-direction: column;
  }

  #business-settings-form .field {
        width: 100%;
      gap: .2rem;
        flex-direction: column;
        display: flex;
    }

  #screen-crm-config .cfg-menu-category-header {
    flex-direction: column;
  }

  #screen-crm-config .cfg-menu-category-card {
    border-right: none !important;
  }

  #screen-crm-config .crm-config-page {
    padding: 15px;
    padding-top: 0;
    margin-top: -70px;
  }

  #screen-crm-config .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  #screen-crm-config .crm-config-actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    display: flex !important;
    width: 100%;
  }

  #screen-crm-config #btn-config-save {
    display: inline-flex !important;
    position: static;
    transform: none;
    left: auto !important;
    top: auto;
    width: 100%;
    justify-content: center;
  }

  #screen-crm-config #btn-config-save:hover {
    transform: none;
  }

  #screen-crm-config .crm-config-mobile-save-wrap {
    display: flex;
    width: 100%;
    margin-top: 14px;
  }

  #screen-crm-config #btn-config-toggle-inactive {
    display: none;
  }

  #screen-crm-config .config-row {
    flex-wrap: nowrap;
  }

  #screen-crm-config .row-end {
    width: auto;
    justify-content: flex-start;
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
  }

  #screen-crm-config .cfg-table thead,
  #screen-crm-config .cfg-statuses-table thead,
  #screen-crm-config .cfg-fields-table thead,
  #screen-crm-config .cfg-order-fields-table thead {
    display: none;
  }

  #screen-crm-config .cfg-table tr,
  #screen-crm-config .cfg-statuses-table tr,
  #screen-crm-config .cfg-fields-table tr,
  #screen-crm-config .cfg-order-fields-table tr {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 10px;
  }

  #screen-crm-config .cfg-table td,
  #screen-crm-config .cfg-statuses-table td,
  #screen-crm-config .cfg-fields-table td,
  #screen-crm-config .cfg-order-fields-table td {
    border: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }

  #screen-crm-config .cfg-table td::before,
  #screen-crm-config .cfg-statuses-table td::before,
  #screen-crm-config .cfg-fields-table td::before,
  #screen-crm-config .cfg-order-fields-table td::before {
    content: attr(data-label);
    font-weight: 800;
    font-size: 12px;
    color: var(--text-muted);
    flex: 0 0 auto;
    max-width: 45%;
  }

  #screen-crm-config .cfg-table td > *:last-child,
  #screen-crm-config .cfg-statuses-table td > *:last-child,
  #screen-crm-config .cfg-fields-table td > *:last-child,
  #screen-crm-config .cfg-order-fields-table td > *:last-child {
    flex: 1 1 auto;
  }

  #screen-crm-config .cfg-table td > label.switch:last-child,
  #screen-crm-config .cfg-statuses-table td > label.switch:last-child,
  #screen-crm-config .cfg-fields-table td > label.switch:last-child,
  #screen-crm-config .cfg-order-fields-table td > label.switch:last-child {
    flex: 0 0 auto;
  }

  #screen-crm-config .cfg-fields-table td.cfg-field-col-options {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
  }

  #screen-crm-config .cfg-fields-table td.cfg-field-col-options::before {
    max-width: none;
  }

  #screen-crm-config .cfg-fields-table td.cfg-field-col-options > *:last-child {
    flex: 0 0 auto;
  }

  #screen-crm-config .cfg-field-options-table {
    width: 100%;
    border-collapse: collapse;
  }

  #screen-crm-config .cfg-fields-table .cfg-field-options-table tr {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  #screen-crm-config .cfg-fields-table .cfg-field-options-table td {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }

  #screen-crm-config .cfg-fields-table .cfg-field-options-table td::before {
    content: none;
  }

  #screen-crm-config .cfg-field-options-table tr {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  #screen-crm-config .cfg-field-options-table td {
    padding: 0;
    border: 0;
  }

  #screen-crm-config .cfg-field-options-table td:first-child {
    flex: 1 1 auto;
    min-width: 0;
  }

  #screen-crm-config .cfg-field-options-table td:last-child {
    flex: 0 0 auto;
  }

  #screen-crm-config .cfg-field-option-input {
    width: 100%;
    min-width: 0;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
  }

  #screen-crm-config .cfg-field-option-remove {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: #fff1f2;
    color: #b91c1c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  #screen-crm-config .cfg-field-option-remove:hover {
    background: #fee2e2;
  }

  #screen-crm-config .cfg-field-option-add-btn {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
  }

  #screen-crm-config .cfg-statuses-table td.cfg-remove-cell.no-remove,
  #screen-crm-config .cfg-fields-table td.cfg-remove-cell.no-remove,
  #screen-crm-config .cfg-order-fields-table td.cfg-remove-cell.no-remove {
    display: none;
  }

  #screen-crm-config .cfg-add-btn-bottom {
    margin-top: 12px;
  }

  #screen-crm-config #tab-sketches .sketch-config-panel {
    width: 100%;
  }

  #screen-crm-config #tab-sketches .sketch-lock-field,
  #screen-crm-config #tab-sketches .sketch-config-actions-row {
    grid-template-columns: 1fr;
  }

  #screen-crm-config #tab-sketches .sketch-open-editor-btn {
    width: 100%;
  }
}

#screen-crm-config .cfg-ctpl-editor-container {
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

#screen-crm-config .cfg-ctpl-toolbar {
  background: #f8fafc;
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 600px) {
  #screen-crm-config .cfg-ctpl-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 15px;
  }

  #screen-crm-config .cfg-ctpl-toolbar::-webkit-scrollbar {
    height: 4px;
  }
  
  #screen-crm-config .cfg-ctpl-toolbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }
}

#screen-crm-config .cfg-ctpl-btn,
#screen-crm-config .cfg-ctpl-select {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-dark);
  height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: 0.2s;
  gap: 6px;
  white-space: nowrap;
}

#screen-crm-config .cfg-ctpl-btn:hover,
#screen-crm-config .cfg-ctpl-select:hover {
  background: #e0f2fe;
  color: var(--brand-blue);
  border-color: var(--brand-blue);
}

#screen-crm-config .cfg-ctpl-btn:focus,
#screen-crm-config .cfg-ctpl-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

#screen-crm-config .cfg-ctpl-select {
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
}

#screen-crm-config .cfg-ctpl-separator {
  width: 1px;
  height: 24px;
  background: #cbd5e1;
  margin: 0 5px;
  flex-shrink: 0;
}

#screen-crm-config .cfg-ctpl-btn-variable {
  padding: 0 12px;
  font-weight: 800;
  color: var(--brand-blue);
  background: #eff6ff;
  border-color: #bfdbfe;
}

#screen-crm-config .cfg-ctpl-var-dropdown { position: relative; }

#screen-crm-config .cfg-ctpl-vars-list {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.10);
  width: 190px;
  display: none;
  z-index: 100;
  margin-top: 6px;
}

#screen-crm-config .cfg-ctpl-vars-list.show {
  display: block;
}

#screen-crm-config .cfg-ctpl-var-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dark);
}

#screen-crm-config .cfg-ctpl-var-item:hover {
  background: #f8fafc;
  color: var(--brand-blue);
}

#screen-crm-config .cfg-ctpl-var-item:last-child {
  border-bottom: none;
}

#screen-crm-config .cfg-ctpl-editor {
  min-height: 320px;
  padding: 28px;
  overflow-y: auto;
  outline: none;
  font-size: 16px;
  line-height: 1.6;
  color: #334155;
  background: #fff;
}

#screen-crm-config .cfg-ctpl-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  cursor: text;
}

#screen-crm-config .cfg-ctpl-editor:focus {
  box-shadow: inset 0 0 0 3px rgba(59, 130, 246, 0.18);
}

#screen-crm-config .cfg-ctpl-editor h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 900;
  color: var(--brand-blue);
}

#screen-crm-config .cfg-ctpl-editor h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
  color: var(--brand-blue);
}

#screen-crm-config .cfg-ctpl-editor p {
  margin: 0 0 10px;
}

#screen-crm-config .cfg-ctpl-editor ul,
#screen-crm-config .cfg-ctpl-editor ol {
  margin: 0 0 10px;
  padding-right: 22px;
}

#screen-crm-config .cfg-ctpl-editor .dynamic-var {
  background: #eff6ff;
  color: var(--brand-blue);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.95em;
  border: 1px dashed #93c5fd;
  user-select: none;
}

#screen-crm-config .cfg-menu-categories-list {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

#screen-crm-config .cfg-menu-editor-switcher {
  margin-bottom: 18px;
}

#screen-crm-config .cfg-menu-editor-switcher-nav {
  gap: 28px;
  margin-bottom: 0;
  justify-content: flex-start;
}

#screen-crm-config .cfg-menu-editor-switcher-nav .form-tab-btn {
  padding: 0 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 800;
}

#screen-crm-config .cfg-menu-editor-switcher-nav .form-tab-btn.active {
  border: 0;
  border-bottom: 2px solid var(--brand-blue);
  background: transparent;
  color: var(--brand-blue);
}

#screen-crm-config .cfg-menu-editor-switcher-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

#screen-crm-config .cfg-menu-editor-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#screen-crm-config #tab-sketches {
  padding-top: 6px;
}

#screen-crm-config #tab-sketches .sketch-config-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 0;
}

#screen-crm-config #tab-sketches .sketch-config-panel > * {
  width: 100%;
}

#screen-crm-config #tab-sketches .sketch-default-chairs-field,
#screen-crm-config #tab-sketches .sketch-config-venue-field {
  min-width: 0;
  margin: 0;
}

#screen-crm-config #tab-sketches .sketch-default-chairs-field,
#screen-crm-config #tab-sketches .sketch-config-venue-field,
#screen-crm-config #tab-sketches .sketch-config-actions-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#screen-crm-config #tab-sketches .sketch-default-chairs-field > .label,
#screen-crm-config #tab-sketches .sketch-config-venue-field > .label {
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: block !important;
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal !important;
}

#screen-crm-config #tab-sketches .sketch-default-chairs-field .input,
#screen-crm-config #tab-sketches .sketch-config-venue-field .input {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
}

#screen-crm-config #tab-sketches .sketch-lock-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
  width: 100%;
  min-width: 0;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06);
}

#screen-crm-config #tab-sketches .sketch-lock-field > .sketch-lock-label {
  all: unset;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  cursor: pointer !important;
  text-align: right !important;
  white-space: normal !important;
}

#screen-crm-config #tab-sketches .sketch-lock-field > .sketch-lock-label .sketch-lock-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: auto !important;
  max-width: none !important;
  color: var(--text1);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  white-space: normal !important;
}

#screen-crm-config #tab-sketches .sketch-lock-field > .sketch-lock-label .sketch-lock-title i {
  font-size: 13px;
  color: var(--primary);
}

#screen-crm-config #tab-sketches .sketch-lock-field > .sketch-lock-label .sketch-lock-subtitle {
  margin-top: 2px;
  width: auto !important;
  max-width: none !important;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  white-space: normal !important;
}

#screen-crm-config #tab-sketches .sketch-lock-field .switch {
  margin-right: 0;
  margin-left: 0;
  flex: 0 0 auto;
}

#screen-crm-config #tab-sketches .sketch-config-actions-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

#screen-crm-config #tab-sketches .sketch-open-editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  white-space: nowrap;
}

#screen-crm-config .cfg-menu-editor-panel {
  display: none;
}

#screen-crm-config .cfg-menu-editor-panel.active {
  display: block;
}

#screen-crm-config .cfg-manual-menu-subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

#screen-crm-config .cfg-manual-menu-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--brand-blue);
  font-size: 13px;
  font-weight: 800;
}

#screen-crm-config .cfg-manual-menu-topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

#screen-crm-config .cfg-manual-menu-field {
  flex: 1 1 260px;
  min-width: 0;
}

#screen-crm-config .cfg-manual-menu-field-title {
  flex-basis: 340px;
}

#screen-crm-config .cfg-manual-menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

#screen-crm-config .cfg-menu-fixed-notes-wrap {
  margin-bottom: 18px;
}

#screen-crm-config .cfg-category-menu-fixed-notes {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

#screen-crm-config .cfg-manual-menu-actions .cfg-manual-menu-new-btn,
#screen-crm-config .cfg-manual-menu-actions .cfg-manual-menu-save-btn,
#screen-crm-config .cfg-manual-menu-actions .cfg-manual-menu-update-btn,
#screen-crm-config .cfg-manual-menu-copy-link-btn,
#screen-crm-config .cfg-manual-menu-open-link-btn {
  font-size: 12px;
}

#screen-crm-config .btn.btn-secondary.cfg-category-menu-new-btn,
#screen-crm-config .btn.btn-secondary.cfg-category-menu-duplicate-btn,
#screen-crm-config .btn.btn-secondary.cfg-category-menu-delete-btn {
  min-height: 42px;
  min-width: 104px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f0f9ff;
  color: var(--brand-blue);
  border: 1px solid var(--brand-blue);
}

#screen-crm-config .btn.btn-secondary.cfg-category-menu-new-btn svg,
#screen-crm-config .btn.btn-secondary.cfg-category-menu-duplicate-btn svg,
#screen-crm-config .btn.btn-secondary.cfg-category-menu-delete-btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--brand-blue);
  stroke: var(--brand-blue);
}

#screen-crm-config .btn.btn-secondary.cfg-category-menu-delete-btn {
  color: var(--red);
  border-color: var(--red);
}

#screen-crm-config .btn.btn-secondary.cfg-category-menu-delete-btn svg {
  color: var(--red);
  stroke: var(--red);
}

#screen-crm-config .btn.btn-secondary.cfg-category-menu-delete-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#screen-crm-config .cfg-manual-menu-editor-shell {
    gap: 3px;
}

#screen-crm-config .cfg-manual-menu-editor-host .richtext-wrap {
  border: 0;
  border-radius: 0;
  background: #fff;
  overflow: hidden;
}
    margin-top: 2px;

#screen-crm-config .cfg-manual-menu-editor-host .richtext-editor {
  min-height: 340px;
}

#screen-crm-config .cfg-manual-menu-editor-container {
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: visible;
  background: #fff;
  position: relative;
  z-index: 1;
}

#screen-crm-config .cfg-manual-menu-editor-container .cfg-ctpl-toolbar {
  position: relative;
  z-index: 3;
}

#screen-crm-config .cfg-manual-menu-link-box {
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  background: #f8fafc;
}

#screen-crm-config .cfg-manual-menu-link-box.is-empty {
  background: #f8fafc;
}

#screen-crm-config .cfg-manual-menu-link-box.has-link {
  background: #f0f9ff;
  border-color: #bae6fd;
}

#screen-crm-config .cfg-manual-menu-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#screen-crm-config .cfg-manual-menu-link-input {
  flex: 1 1 360px;
}

#screen-crm-config .cfg-manual-menu-copy-link-btn {
  transition: opacity .18s ease;
}

#screen-crm-config .cfg-manual-menu-copy-link-btn.is-copied {
  opacity: .45;
}

#screen-crm-config .cfg-menu-add-category-wrap {
  display: flex;
  justify-content: flex-end;
  padding: 16px 0 0;
}

#screen-crm-config .cfg-menu-category-card {
  border: 1px solid color-mix(in srgb, var(--menu-category-color, var(--brand-blue)) 70%, #ffffff);
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--menu-category-color, var(--brand-blue)) 22%, transparent),
    0 10px 22px rgba(15, 23, 42, 0.05);
  transition: box-shadow .18s ease, border-color .18s ease;
}

#screen-crm-config .cfg-menu-category-card:hover {
  border-color: color-mix(in srgb, var(--menu-category-color, var(--brand-blue)) 85%, #ffffff);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--menu-category-color, var(--brand-blue)) 30%, transparent),
    0 14px 26px rgba(15, 23, 42, 0.08);
}

#screen-crm-config .cfg-menu-category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid #f1f5f9;
}

#screen-crm-config .cfg-menu-category-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1 1 auto;
}

#screen-crm-config .cfg-menu-category-image-wrap {
  width: 180px;
  max-width: 100%;
  position: relative;
  z-index: 1;
  margin-top: -8px;
}

#screen-crm-config .cfg-menu-category-image-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 90px;
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  transform-origin: top left;
  position: relative;
  z-index: 1;
}

#screen-crm-config .cfg-menu-category-image-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  cursor: zoom-in;
}

#screen-crm-config .cfg-menu-category-image-wrap.has-image:hover {
  z-index: 40;
}

#screen-crm-config .cfg-menu-category-image-preview.has-image:hover {
  transform: scale(2.2);
  border-color: color-mix(in srgb, var(--primary, #4f46e5) 35%, #cbd5e1);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
}

#screen-crm-config .cfg-menu-category-image-preview.no-image {
  cursor: default;
}

@media (min-width: 901px) {
  #screen-crm-config .cfg-menu-categories-list {
    max-height: none;
    overflow: visible;
    padding-inline-end: 0;
  }

  #screen-crm-config .cfg-menu-category-image-wrap {
    width: 126px;
  }

  #screen-crm-config .cfg-menu-category-title {
    width: 100%;
    max-width: 240px;
  }
}

#screen-crm-config .cfg-menu-category-image-empty {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 700;
}

#screen-crm-config .cfg-menu-category-image-actions {
  margin-top: 6px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#screen-crm-config .cfg-menu-category-image-actions .cfg-menu-category-image-upload-btn,
#screen-crm-config .cfg-menu-category-image-actions .cfg-menu-category-image-remove-btn {
  width: auto;
  justify-content: center;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1.2;
}

#screen-crm-config .cfg-menu-category-image-actions .cfg-menu-category-image-remove-btn {
  border-color: #fbcaca;
  color: #b91c1c;
}

#screen-crm-config .cfg-menu-category-inputs {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#screen-crm-config .cfg-menu-category-inputs .form-label {
  margin-bottom: 0;
  margin-top: 16px;
  align-self: flex-start;
}

#screen-crm-config .cfg-menu-category-inputs .form-label:first-child {
  margin-top: 0;
}

#screen-crm-config .cfg-menu-category-title,
#screen-crm-config .cfg-menu-category-notes,
#screen-crm-config .cfg-menu-category-image,
#screen-crm-config .cfg-menu-dish-title,
#screen-crm-config .cfg-menu-dish-description,
#screen-crm-config .cfg-menu-dish-notes {
  border: 1px solid var(--border-color);
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
}

#screen-crm-config .cfg-menu-category-title {
  font-size: 16px;
  font-weight: 400;
  width: min(100%, 340px);
  align-self: flex-start;
}

#screen-crm-config .cfg-menu-category-notes-toggle {
  align-self: flex-start;
  margin-top: 6px;
}

#screen-crm-config .cfg-menu-category-notes-toggle svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

#screen-crm-config .cfg-menu-category-notes {
  width: min(100%, 460px);
  align-self: flex-start;
}

#screen-crm-config .cfg-menu-category-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

#screen-crm-config .cfg-menu-category-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

#screen-crm-config .cfg-menu-category-actions > .cfg-color-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  padding: 0;
  margin-right: 15px;
  margin-bottom: 10px;
}

#screen-crm-config .cfg-menu-category-visible {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #334155;
  font-weight: 700;
  margin-bottom: 10px;
}

#screen-crm-config .cfg-menu-category-visible .switch {
  margin: 0;
  width: 37px;
  height: 20px;
}

#screen-crm-config .cfg-menu-category-visible .switch .slider:before {
  width: 15px;
  height: 15px;
  right: 2px;
  bottom: 2px;
}

#screen-crm-config .cfg-menu-category-visible .switch input:checked + .slider:before {
  transform: translateX(-17px);
}

#screen-crm-config .cfg-menu-table {
  width: calc(100% - 48px);
  margin: 0 24px;
  border-radius: 10px;
  overflow: visible;
}

#screen-crm-config .cfg-table.cfg-menu-table td {
  vertical-align: top;
  padding-top: 14px;
}

#screen-crm-config .cfg-menu-tags-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#screen-crm-config .cfg-menu-dish-notes-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#screen-crm-config .cfg-menu-notes-dropdown {
  width: 320px;
}

#screen-crm-config .cfg-menu-notes-hint {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

#screen-crm-config .cfg-menu-note-empty {
  font-size: 12px;
  color: #64748b;
}

#screen-crm-config .cfg-menu-selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#screen-crm-config .cfg-menu-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-light, #e8f0fe);
  color: var(--primary, #4f46e5);
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
}

#screen-crm-config .cfg-menu-chip-remove {
  border: 0;
  background: transparent;
  color: var(--primary, #4f46e5);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 14px;
  opacity: .7;
  transition: opacity .15s;
}
#screen-crm-config .cfg-menu-chip-remove:hover {
  opacity: 1;
}

#screen-crm-config .cfg-menu-tag-picker {
  position: relative;
}

#screen-crm-config .cfg-menu-tag-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px dashed var(--border-color, #cbd5e1);
  color: var(--primary, #4f46e5);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

#screen-crm-config .cfg-menu-tag-toggle-btn:hover {
  background: var(--primary-light, #e8f0fe);
  border-color: var(--primary, #4f46e5);
}

#screen-crm-config .cfg-menu-tag-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  width: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  border: 1px solid var(--border-color, #e2e8f0);
  overflow: hidden;
}

#screen-crm-config .cfg-menu-tag-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  font-weight: 700;
  font-size: 13px;
  color: #1e293b;
}

#screen-crm-config .cfg-menu-tag-dropdown-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0;
}

#screen-crm-config .cfg-menu-tag-dropdown-close:hover {
  color: #1e293b;
}

#screen-crm-config .cfg-menu-tag-dropdown-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
}

#screen-crm-config .cfg-menu-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  transition: background .12s;
  width: 100%;
  box-sizing: border-box;
}

#screen-crm-config .cfg-menu-picker-row:hover {
  background: #f1f5f9;
}

#screen-crm-config .cfg-menu-picker-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#screen-crm-config .cfg-menu-picker-check input[type="checkbox"] {
  accent-color: var(--primary, #4f46e5);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

#screen-crm-config .cfg-menu-picker-name-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  font-size: 13px;
  color: #334155;
}

#screen-crm-config .cfg-menu-picker-remove {
  width: 30px;
  height: 30px;
}

#screen-crm-config .cfg-menu-tag-dropdown-footer {
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding: 10px 14px;
}

#screen-crm-config .cfg-menu-tag-apply-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--primary, #4f46e5) 35%, #cbd5e1);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--primary, #4f46e5);
  cursor: pointer;
  margin-left: 8px;
}

#screen-crm-config .cfg-menu-tag-apply-btn:hover {
  filter: brightness(0.95);
}

#screen-crm-config .cfg-menu-tag-new-btn {
  background: none;
  border: none;
  color: var(--primary, #4f46e5);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  transition: opacity .15s;
}

#screen-crm-config .cfg-menu-tag-new-btn:hover {
  opacity: .8;
}

#screen-crm-config .cfg-menu-tag-new-inline {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#screen-crm-config .cfg-menu-tag-new-input {
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}

#screen-crm-config .cfg-menu-tag-new-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#screen-crm-config .cfg-menu-tag-new-save-btn,
#screen-crm-config .cfg-menu-tag-new-cancel-btn {
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  background: #fff;
}

#screen-crm-config .cfg-menu-tag-new-save-btn {
  color: var(--primary, #4f46e5);
  border-color: color-mix(in srgb, var(--primary, #4f46e5) 30%, #cbd5e1);
}

#screen-crm-config .cfg-menu-category-card .footer-actions {
  width: calc(100% - 48px);
  margin: 0 24px;
  padding: 12px 16px 16px;
  border-top: 0;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: 0 0 10px 10px;
  background: #fcfcfc;
}

#screen-crm-config .cfg-menu-category-card .footer-actions .cfg-menu-add-dish-btn {
  margin-right: 4px;
  margin-bottom: 2px;
}

/* ── Business Settings tab ───────────────────────── */
.business-settings-tab-content {
  padding: 8px 0;
}

#screen-crm-config .business-settings-actions-row,
#screen-crm-config .business-settings-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#screen-crm-config .business-settings-actions-row {
  margin-top: 16px;
}

#screen-crm-config #businessSettingsMaskyooList {
  margin-top: 18px;
}

#screen-crm-config #businessSettingsMaskyooList .config-card:last-child {
  margin-bottom: 0;
}

#screen-crm-config .maskyoo-num-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

#screen-crm-config .maskyoo-num-number {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-blue);
  direction: ltr;
  unicode-bidi: embed;
}

#screen-crm-config .maskyoo-num-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

#screen-crm-config .maskyoo-num-status-active {
  color: var(--lbl1);
  background: var(--lbl13);
}

#screen-crm-config .maskyoo-num-status-inactive {
  color: var(--dark-gray);
  background: var(--lightgray);
}

#screen-crm-config .maskyoo-destination-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

#screen-crm-config .maskyoo-destination-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#screen-crm-config .maskyoo-destination-row .business-settings-maskyoo-destination-input {
  flex: 1 1 auto;
  direction: ltr;
  unicode-bidi: embed;
}

#screen-crm-config .maskyoo-destination-row .btn {
  flex: 0 0 auto;
  min-height: 42px;
}

#screen-crm-config .maskyoo-destination-tools {
  margin-top: 12px;
}

#screen-crm-config .maskyoo-num-meta {
  display: flex;
  flex-direction: row;
  gap: 24px;
  flex-wrap: wrap;
}

#screen-crm-config .maskyoo-num-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#screen-crm-config .maskyoo-num-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#screen-crm-config .maskyoo-num-field > span:last-child {
  font-size: 15px;
  color: var(--text-dark);
}

#screen-crm-config .maskyoo-num-destinations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#screen-crm-config .maskyoo-num-destination-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--lightblue2);
  color: var(--text-dark);
  direction: ltr;
  unicode-bidi: embed;
}

#screen-crm-config .business-settings-list-actions [data-action="delete-maskyoo"] {
  color: var(--delete);
}


/* -- System Admins modal ----------------------------------------- */
#system-admins-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9998;
  background: rgba(30, 78, 132, 0.4);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: pointer;
}

#system-admins-modal-overlay.open {
  display: flex;
}

#system-admins-modal-overlay .sysadmin-modal-card {
  width: 860px;
  max-width: 95vw;
  max-height: 88vh;
  padding: 0;
  text-align: right;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18);
  cursor: default;
  display: flex;
  flex-direction: column;
}

.sysadmin-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  background: #fff;
}

.sysadmin-modal-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.sysadmin-modal-title {
  font-size: 17px;
  font-weight: 900;
  color: #1e3a5f;
  flex: 1 1 auto;
  margin: 0;
}

.sysadmin-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sysadmin-modal-new-btn {
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 400;
  cursor: pointer;
  font-size: 13px;
  min-height: 34px;
  white-space: nowrap;
  transition: background 0.2s;
}

.sysadmin-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.sysadmin-modal-close svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.sysadmin-modal-body {
  overflow-y: auto;
  flex: 1 1 auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f0f4f8;
}

.sysadmin-section {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 18px 20px;
}

.sysadmin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  gap: 10px;
}

.sysadmin-section-title {
  font-size: 15px;
  font-weight: 900;
  color: #1e3a5f;
  margin: 0;
}

.sysadmin-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.sysadmin-meta-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sysadmin-meta-info .meta-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.sysadmin-meta-info .meta-value {
  font-size: 14px;
  font-weight: 800;
  color: #2b3442;
  direction: ltr;
  unicode-bidi: embed;
}

.sysadmin-count {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
}

.sysadmin-notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 14px;
  color: #1e40af;
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.sysadmin-notice svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #3b82f6;
}

.sysadmin-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.sysadmin-type-badge.type-super {
  background: #fef9c3;
  color: #854d0e;
}

.sysadmin-type-badge.type-myadmin {
  background: #eff6ff;
  color: #1d4ed8;
}

.sysadmin-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.sysadmin-status-badge.status-active {
  background: #dcfce7;
  color: #166534;
}

.sysadmin-status-badge.status-inactive {
  background: #f1f5f9;
  color: #64748b;
}

.sysadmin-feedback {
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  margin-top: 12px;
}

.sysadmin-feedback[data-state="success"] {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.sysadmin-feedback[data-state="error"] {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.sysadmin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.sysadmin-table th {
  text-align: right;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.sysadmin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  vertical-align: middle;
}

.sysadmin-table tr:last-child td {
  border-bottom: none;
}

.sysadmin-table-empty {
  text-align: center;
  padding: 28px 16px;
  color: #94a3b8;
  font-size: 14px;
}

.sysadmin-modal-body .form-group {
  margin-bottom: 16px;
}

.sysadmin-modal-body .form-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #2b3442;
}

.sysadmin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.sysadmin-form-grid .form-group.span-full {
  grid-column: 1 / -1;
}

.sysadmin-profile-field {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sysadmin-profile-preview {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--white);
  object-fit: cover;
  flex-shrink: 0;
}

.sysadmin-profile-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.sysadmin-profile-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sysadmin-profile-file-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--black);
  word-break: break-word;
}

.sysadmin-profile-hint {
  font-size: 12px;
  color: var(--text1);
}

#sysadmin-modal-profile-image-trigger {
  padding: 0.245rem 0.49rem;
  min-height: 25px;
  font-size: 14px;
}

#sysadmin-modal-refresh,
.sysadmin-table button[data-action="edit"],
.sysadmin-table button[data-action="delete"] {
  font-size: 14px;
}

.sysadmin-table-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  object-fit: cover;
  display: block;
}

.sysadmin-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding-top: 6px;
}

.sysadmin-save-btn {
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 4px 15px rgba(30, 78, 132, 0.2);
  min-height: 40px;
  white-space: nowrap;
  font-size: 16px;
}

@media (hover: hover) {
  .sysadmin-modal-close:hover {
    background: #e2e8f0;
    color: var(--primary);
    transform: rotate(90deg);
  }

  #screen-crm-config .nav-tab:hover {
    background: var(--brand-blue);
    color: #fff;
    box-shadow: 0 4px 10px rgba(30, 78, 132, 0.2);
  }

  #screen-crm-config .nav-tab.active:hover {
    background: var(--brand-blue);
    color: #fff;
    box-shadow: 0 4px 10px rgba(30, 78, 132, 0.2);
  }

  #btnIncomingLeadCreateToken:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
  }

  #screen-crm-config .btn.btn-secondary.cfg-category-menu-new-btn:hover,
  #screen-crm-config .btn.btn-secondary.cfg-category-menu-duplicate-btn:hover {
    background: #f0f9ff;
    border-color: var(--brand-blue);
  }

  #screen-crm-config .btn.btn-secondary.cfg-category-menu-delete-btn:hover {
    background: color-mix(in srgb, var(--red) 8%, #fff);
    border-color: var(--red);
  }

  .sysadmin-modal-new-btn:hover,
  .sysadmin-save-btn:hover {
    background: var(--primary-dark, #1b3f6b);
  }

  .sysadmin-save-btn:hover {
    transform: translateY(-1px);
  }

  .sysadmin-table tbody tr:hover td {
    background: #f8fafc;
  }

  #screen-crm-config .business-settings-list-actions [data-action="delete-maskyoo"]:hover {
    background: color-mix(in srgb, var(--delete) 8%, #fff);
    border-color: var(--delete);
  }
}

@media (max-width: 767px) {
  #system-admins-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  #screen-crm-config .maskyoo-destination-row {
    flex-direction: column;
    align-items: stretch;
  }

  #screen-crm-config .maskyoo-destination-row .btn {
    width: 100%;
  }

  #system-admins-modal-overlay .sysadmin-modal-card {
    max-width: 100%;
    max-height: 92vh;
    width: 100%;
    border-radius: 20px 20px 0 0;
    transform: translateY(30px);
  }

  #system-admins-modal-overlay.open .sysadmin-modal-card {
    transform: none;
  }

  .sysadmin-form-grid {
    grid-template-columns: 1fr;
  }

  .sysadmin-profile-field {
    align-items: flex-start;
  }

  .sysadmin-table thead {
    display: none;
  }

  .sysadmin-table tr {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
  }

  .sysadmin-table td {
    border: none;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
  }

  .sysadmin-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 11px;
    color: #94a3b8;
    flex: 0 0 auto;
    max-width: 45%;
  }
}