/* CRM Add Custom Fields */
.crm-top-checkout {
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 4px;
  background: #25b7a7;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.crm-top-clock {
  font-size: 16px;
  font-weight: 600;
  color: #25b7a7;
  font-variant-numeric: tabular-nums;
  min-width: 46px;
  text-align: center;
}
.crm-top-icon { color: #25b7a7 !important; }
.crm-profile-caret { width: 14px; height: 14px; color: #94a3b8; flex-shrink: 0; }

.cf-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: #f4f7f6;
  margin: -16px calc(var(--content-pad-x) * -1) -24px;
  padding: 16px var(--content-pad-x) 24px;
}
.cf-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.cf-back {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #25B7A7;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.cf-back svg { width: 16px; height: 16px; }
.cf-back:hover { background: #1a9e8f; }
.cf-nav__label {
  font-size: 15px;
  font-weight: 500;
  color: #4a5560;
}

.cf-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
  padding: 22px 24px 28px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.cf-card__head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.cf-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #25B7A7;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.cf-type {
  position: relative;
  width: min(280px, 100%);
  z-index: 12;
}
.cf-type.is-open { z-index: 30; }
.cf-type__input {
  width: 100%;
  height: 38px;
  border: 1px solid #d8e2e8;
  border-radius: 6px;
  padding: 0 34px 0 12px;
  font-size: 14px;
  color: #94a3b8;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
}
.cf-type.is-open .cf-type__input,
.cf-type__input:focus {
  outline: none;
  border-color: #25B7A7;
  box-shadow: 0 0 0 2px rgba(37, 183, 167, .16);
  color: #64748b;
}
.cf-type__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e6edf2;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
  z-index: 40;
  display: none;
}
.cf-type.is-open .cf-type__menu { display: block; }
.cf-type__item {
  padding: 4px 12px;
  font-size: 13px;
  line-height: 1.25;
  color: #1f2933;
  cursor: pointer;
  font-weight: 400;
}
.cf-type__item:hover { background: #e8f8f6; }
.cf-type__item.is-active {
  background: #e8f8f6;
  font-weight: 700;
}

.cf-add-btn {
  margin-left: auto;
  height: 40px;
  padding: 0 18px 0 8px;
  border: none;
  border-radius: 8px;
  background: #25B7A7;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 183, 167, .28);
}
.cf-add-btn__icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: #25B7A7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cf-add-btn__icon svg { width: 14px; height: 14px; }
.cf-add-btn:hover { background: #1a9e8f; }
.cf-add-btn.is-hidden { display: none; }

.cf-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 180px;
}
.cf-field-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  z-index: 1;
  overflow: visible;
}
.cf-field-wrap:focus-within,
.cf-field-wrap:has(.cf-kind.is-open) { z-index: 8; }
.cf-field {
  flex: 1;
  min-width: 0;
  background: #f3f5f6;
  border: 1px solid #eceff1;
  border-radius: 8px;
  padding: 14px 16px 16px;
  overflow: visible;
}
.cf-field__label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e3e7ea;
}
.cf-field__label {
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: #25B7A7;
  padding: 0;
  min-width: 90px;
  outline: none;
}
.cf-field__edit {
  color: #25B7A7;
  display: inline-flex;
  cursor: pointer;
}
.cf-field__edit svg { width: 15px; height: 15px; }
.cf-field__row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.cf-kind {
  position: relative;
  width: 180px;
  flex-shrink: 0;
  z-index: 2;
}
.cf-kind.is-open { z-index: 20; }
.cf-kind__input {
  width: 100%;
  height: 36px;
  border: 1px solid #d8e2e8;
  border-radius: 4px;
  padding: 0 28px 0 12px;
  font-size: 14px;
  color: #94a3b8;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
}
.cf-kind.is-open .cf-kind__input,
.cf-kind__input:focus {
  outline: none;
  border-color: #25B7A7;
  box-shadow: 0 0 0 2px rgba(37, 183, 167, .16);
  color: #94a3b8;
}
.cf-kind__menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 170px;
  background: #fff;
  border: 1px solid #e6edf2;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
  z-index: 30;
  display: none;
}
.cf-kind.is-open .cf-kind__menu { display: block; }
.cf-kind__item {
  padding: 3px 12px;
  font-size: 13px;
  line-height: 1.25;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
}
.cf-kind__item:hover { background: #f0f2f3; }
.cf-kind__item.is-active { background: #f0f2f3; }

.cf-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #5b6b78;
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.cf-meta svg { width: 16px; height: 16px; flex-shrink: 0; }
.cf-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #25B7A7;
  font-size: 14px;
  font-weight: 500;
}
.cf-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.cf-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cf-switch span {
  display: block;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #cfd6dc;
  position: relative;
  cursor: pointer;
  transition: background .2s;
}
.cf-switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .2s;
}
.cf-switch input:checked + span { background: #25B7A7; }
.cf-switch input:checked + span::after { transform: translateX(18px); }
.cf-field__delete {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #8c8c8c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cf-field__delete svg { width: 16px; height: 16px; }
.cf-field__delete:hover { color: #ff4d4f; }
.cf-plus {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #25B7A7;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(37, 183, 167, .28);
}
.cf-plus svg { width: 18px; height: 18px; }
.cf-plus:hover { background: #1a9e8f; }

.cf-card__foot {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}
.cf-btn {
  height: 38px;
  padding: 0 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.cf-btn--save {
  background: #25B7A7;
  color: #fff;
}
.cf-btn--save:hover { background: #1a9e8f; }
.cf-btn--reset {
  background: #3d4f66;
  color: #fff;
}
.cf-btn--reset:hover { background: #324257; }

.cf-app-footer {
  margin-top: auto;
  padding: 28px 8px 8px;
  text-align: center;
}
.cf-app-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
.cf-app-footer__links a {
  color: #25B7A7;
  text-decoration: none;
  font-weight: 500;
}
.cf-app-footer__links a:hover { text-decoration: underline; }
.cf-app-footer__links span { color: #bfbfbf; }
.cf-app-footer__copy {
  margin: 0;
  font-size: 12px;
  color: #8c8c8c;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .cf-add-btn { margin-left: 0; }
  .cf-field__delete { margin-left: 0; }
}
