.crm-account-bar {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 20px 24px;
  margin-bottom: 24px;
  background: var(--accent-soft);
  border-radius: var(--radius);
}
.crm-account-bar label {
  min-width: min(100%, 300px);
  margin: 0;
}
.crm-account-bar p {
  margin: 0;
}
.crm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}
.crm-filters {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) repeat(3, minmax(120px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.crm-call-automation {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
  padding: 22px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.crm-call-automation h3 {
  margin: 0 0 8px;
}
.crm-call-automation p {
  margin: 8px 0 0;
}
.crm-call-counts {
  font-weight: 600;
}
.crm-call-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 260px;
  max-width: 350px;
}
@media (max-width: 800px) {
  .crm-call-automation {
    flex-direction: column;
    align-items: stretch;
  }
  .crm-call-controls {
    min-width: 0;
    max-width: none;
  }
}
.crm-filters label {
  margin: 0;
}
.crm-filters button {
  margin-bottom: 0;
  min-height: 44px;
}
.crm-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.crm-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.crm-stat span {
  color: var(--muted);
  font-size: 0.8rem;
}
.crm-stat strong {
  font-size: 1.9rem;
  letter-spacing: -0.04em;
}
.crm-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.crm-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
  font-size: 0.84rem;
}
.crm-table th {
  text-align: left;
  font-size: 0.71rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 17px 18px;
  background: var(--surface-soft);
}
.crm-table td {
  padding: 18px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  max-width: 280px;
  overflow-wrap: anywhere;
}
.crm-table td strong {
  display: block;
}
.crm-row-new,
.crm-status-new {
  --crm-row-bg: #d6edc4;
  --crm-row-ink: #175b35;
  --crm-row-line: #b4d1a2;
}
.crm-row-contacted,
.crm-status-contacted {
  --crm-row-bg: #b9defa;
  --crm-row-ink: #164e7a;
  --crm-row-line: #8ebadf;
}
.crm-row-information_meeting,
.crm-status-information_meeting {
  --crm-row-bg: #ffe2bf;
  --crm-row-ink: #7a3e00;
  --crm-row-line: #e6b57a;
}
.crm-row-interview,
.crm-status-interview {
  --crm-row-bg: #e5cef4;
  --crm-row-ink: #59317c;
  --crm-row-line: #c8a4df;
}
.crm-row-interview_stage,
.crm-status-interview_stage {
  --crm-row-bg: #ff09b6;
  --crm-row-ink: #2e0024;
  --crm-row-line: #aa0086;
}
.crm-row-documents,
.crm-status-documents {
  --crm-row-bg: #ffedb1;
  --crm-row-ink: #6a4900;
  --crm-row-line: #e1c875;
}
.crm-row-profile_validated,
.crm-status-profile_validated {
  --crm-row-bg: #12dd00;
  --crm-row-ink: #063b08;
  --crm-row-line: #009b00;
}
.crm-row-enrolled,
.crm-status-enrolled {
  --crm-row-bg: #ffbf00;
  --crm-row-ink: #4c3200;
  --crm-row-line: #b38500;
}
.crm-row-rejected,
.crm-status-rejected {
  --crm-row-bg: #fbd0ca;
  --crm-row-ink: #91281f;
  --crm-row-line: #e8aaa1;
}
.crm-table .crm-row > td {
  background: var(--crm-row-bg);
  color: var(--crm-row-ink);
  border-color: var(--crm-row-line);
  transition: box-shadow 150ms ease;
}
.crm-table .crm-row:hover > td {
  box-shadow: inset 0 0 0 999px rgb(255 255 255 / 9%);
}
.crm-table .crm-row-interview_stage:hover > td,
.crm-table .crm-row-profile_validated:hover > td,
.crm-table .crm-row-enrolled:hover > td {
  box-shadow: none;
}
.crm-table .crm-row .cell-detail {
  color: inherit;
  opacity: 0.88;
}
.crm-table .crm-contact-cell {
  min-width: 180px;
}
.crm-table .crm-training-cell {
  min-width: 220px;
}
.crm-table .crm-stage-cell {
  min-width: 210px;
  max-width: none;
}
.crm-status-select {
  min-width: 174px;
  width: 100%;
  padding: 10px 28px 10px 10px;
  margin: 0;
  border: 1px solid var(--crm-row-line);
  border-radius: 10px;
  background: rgb(255 255 255 / 35%);
  color: var(--crm-row-ink);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.crm-row-interview_stage .crm-status-select,
.crm-row-profile_validated .crm-status-select,
.crm-row-enrolled .crm-status-select {
  background: var(--crm-row-bg);
}
.crm-status-select:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}
.crm-status-select:disabled {
  cursor: progress;
  opacity: 0.7;
}
.crm-status-select option {
  background: #fff;
  color: #202334;
}
.crm-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 115px;
}
.crm-row-actions button {
  font-size: 0.75rem;
  padding: 10px 12px;
}
.crm-row-actions .secondary,
.crm-row-actions .danger {
  background: rgb(255 255 255 / 65%);
  border-color: var(--crm-row-line);
  color: var(--crm-row-ink);
}
.crm-row-actions .danger {
  color: #982c24;
}
.crm-row-interview_stage .crm-row-actions .danger {
  color: #7a201a;
}
.crm-status {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 30px;
  background: var(--crm-row-bg, var(--accent-soft));
  color: var(--crm-row-ink, var(--accent));
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
}
.crm-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  font-size: 0.8rem;
}
.crm-empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  padding: 38px 25px;
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}
.crm-form-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 10px;
  overflow-wrap: anywhere;
  font-size: 0.85rem;
}
.crm-record-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 5px 0 24px;
}
.crm-record-heading h3 {
  font-size: 1.4rem;
  margin: 0;
}
.crm-table .crm-name-link {
  display: inline;
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
}
.crm-name-link:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}
.crm-phone-cell,
.crm-age-cell {
  white-space: nowrap;
}
.crm-record-delete {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.crm-stage-fields[hidden] {
  display: none;
}
.crm-stage-form .crm-toolbar {
  margin-top: 20px;
}
.crm-import-criteria,
.crm-import-exclusions {
  padding: 16px 20px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
}
.crm-import-exclusions li {
  margin-top: 8px;
}
.crm-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 24px 0;
}
.crm-details dt {
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 4px;
}
.crm-details dd {
  font-size: 0.87rem;
  margin: 0;
  overflow-wrap: anywhere;
}
.crm-note-form {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.crm-note {
  padding: 16px 18px;
  background: var(--surface-soft);
  border-radius: 10px;
  margin: 12px 0;
}
.crm-note p {
  white-space: pre-wrap;
  font-size: 0.86rem;
  margin: 0 0 8px;
}
.crm-note small {
  color: var(--muted);
  font-size: 0.72rem;
}
.crm-history,
.crm-field-section,
.crm-mapping {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 18px 0;
}
.crm-history summary,
.crm-field-section summary,
.crm-mapping summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
}
.crm-history[open] summary,
.crm-field-section[open] summary,
.crm-mapping[open] summary {
  margin-bottom: 18px;
}
.crm-history-entry {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}
.crm-import-preview {
  margin-top: 20px;
}
.crm-import-result {
  font-weight: 700;
  padding: 16px;
  background: var(--accent-soft);
  border-radius: 12px;
  font-size: 0.86rem;
}
.crm-import-errors {
  max-height: 220px;
  overflow: auto;
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.8;
}
.crm-connection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 20px 0;
}
.crm-connection-card,
.crm-section {
  background: var(--surface);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.crm-connection-card {
  margin: 0;
}
.crm-connection-card h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.crm-connection-card p {
  font-size: 0.84rem;
}
.crm-connection-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--ink);
  color: var(--surface);
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 20px;
}
.crm-connection-mark.snapchat {
  background: #ffef59;
  color: #171717;
}
.crm-secret {
  font-family: monospace;
  overflow-wrap: anywhere;
  background: var(--surface-soft);
  padding: 16px;
  user-select: all;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.crm-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 15px;
  flex-wrap: wrap;
}
.crm-section-heading h2 {
  margin-bottom: 8px;
}
.crm-event {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.crm-event p {
  font-size: 0.84rem;
  margin: 5px 0;
}
.crm-event-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.crm-code-label {
  font-family: monospace;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}
.crm-key-warning {
  background: var(--warning-bg);
  color: var(--warning);
  padding: 14px;
  border-radius: 10px;
  font-size: 0.84rem;
}
@media (max-width: 1100px) {
  .crm-filters {
    grid-template-columns: 1fr 1fr;
  }
  .crm-filters button {
    justify-self: start;
  }
  .crm-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .crm-account-bar {
    flex-wrap: wrap;
  }
}
@media (max-width: 650px) {
  .crm-filters {
    grid-template-columns: 1fr;
  }
  .crm-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .crm-stat {
    padding: 16px;
  }
  .crm-connection-grid,
  .crm-details {
    grid-template-columns: 1fr;
  }
  .crm-pagination {
    justify-content: space-between;
    gap: 8px;
  }
  .crm-pagination span {
    font-size: 0.7rem;
  }
  .crm-toolbar button {
    flex: 1 1 auto;
  }
  .crm-record-heading {
    align-items: start;
  }
  .crm-account-bar {
    padding: 16px;
  }
  .crm-account-bar label {
    width: 100%;
  }
  .crm-connection-card,
  .crm-section {
    padding: 18px;
  }
}
