#hub-pane-crm {
  --crm-accent: #46e6b3;
  --crm-line: rgba(176, 211, 220, 0.17);
  color: #dce8ed;
}
.crm-topline,
.crm-toolbar,
.crm-tabs,
.crm-row,
.crm-rule,
.crm-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.crm-topline {
  justify-content: space-between;
  margin-bottom: 24px;
}
.crm-topline h2 {
  font:
    600 clamp(24px, 3vw, 36px) "Space Grotesk",
    sans-serif;
  margin: 4px 0 10px;
}
.crm-topline p {
  margin: 0;
  max-width: 760px;
  color: #a5b9c2;
}
.crm-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--crm-line);
  border-radius: 30px;
  padding: 8px 14px;
  font-size: 12px;
  white-space: nowrap;
}
.crm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f5b558;
}
.crm-dot.online {
  background: var(--crm-accent);
}
.crm-tabs {
  border-bottom: 1px solid var(--crm-line);
  margin-bottom: 24px;
  gap: 4px;
}
.crm-tabs button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #9eb6c0;
  padding: 13px 20px;
  font: 600 14px Inter;
  cursor: pointer;
}
.crm-tabs button[aria-selected="true"] {
  color: var(--crm-accent);
  border-bottom-color: var(--crm-accent);
}
.crm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}
.crm-card {
  border: 1px solid var(--crm-line);
  border-radius: 14px;
  padding: 24px;
  background: rgba(12, 27, 36, 0.83);
  min-width: 0;
}
.crm-card h3 {
  font: 600 20px "Space Grotesk";
  margin: 0 0 18px;
}
.crm-card + .crm-card {
  margin-top: 20px;
}
.crm-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: #b2c9d2;
  margin-bottom: 16px;
}
.crm-label input,
.crm-label select,
.crm-label textarea,
.crm-rule input,
.crm-rule select {
  font: 14px Inter;
  background: #0b1922;
  color: #e5eff3;
  border: 1px solid #304652;
  border-radius: 7px;
  padding: 11px;
  max-width: 100%;
  min-width: 0;
}
.crm-label textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.6;
}
.crm-rule select {
  max-width: 270px;
}
.crm-rule input {
  width: 130px;
}
.crm-btn {
  border: 1px solid #385563;
  border-radius: 8px;
  background: #152c38;
  color: #e2edf2;
  padding: 10px 15px;
  font: 600 13px Inter;
  cursor: pointer;
  white-space: normal;
}
.crm-btn.primary {
  background: #42ddb0;
  border-color: #42ddb0;
  color: #071d19;
}
.crm-btn.danger {
  border-color: #be6c70;
  color: #f9b2b7;
}
.crm-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.crm-btn.small {
  padding: 6px 10px;
  font-size: 12px;
}
.crm-btn:hover:not(:disabled) {
  filter: brightness(1.12);
}
.crm-status {
  padding: 14px 18px;
  border-radius: 8px;
  border-left: 3px solid #53c6dd;
  background: #102b37;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}
.crm-status.error {
  border-color: #ed9a81;
  background: #352421;
}
.crm-muted {
  color: #92aab6;
  font-size: 12px;
  line-height: 1.6;
}
.crm-group {
  border: 1px solid #304651;
  border-radius: 10px;
  padding: 15px;
  margin: 12px 0;
  background: rgba(18, 40, 51, 0.4);
}
.crm-group .crm-group {
  border-left: 3px solid #459c88;
}
.crm-group-head {
  justify-content: space-between;
  margin-bottom: 14px;
}
.crm-rule {
  margin: 10px 0;
  gap: 7px;
}
.crm-logic {
  display: flex;
  gap: 4px;
}
.crm-logic button {
  padding: 6px 12px;
}
.crm-logic .selected {
  background: #42ddb0;
  color: #071d19;
}
.crm-scroll {
  overflow: auto;
  max-height: 550px;
}
.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}
.crm-table th {
  position: sticky;
  top: 0;
  background: #17303c;
  text-align: left;
  color: #a6c4ce;
  font-weight: 500;
}
.crm-table th,
.crm-table td {
  padding: 12px;
  border-bottom: 1px solid var(--crm-line);
}
.crm-table tr:hover {
  background: #152d38;
}
.crm-table td.message {
  white-space: pre-wrap;
  min-width: 260px;
  max-width: 480px;
  line-height: 1.6;
}
.crm-item {
  padding: 16px 0;
  border-top: 1px solid var(--crm-line);
}
.crm-item strong {
  display: block;
  margin-bottom: 7px;
}
.crm-item .crm-toolbar {
  margin-top: 10px;
}
.crm-preview {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 14px;
  padding: 18px;
  background: #112831;
  border-left: 3px solid var(--crm-accent);
  border-radius: 8px;
}
.crm-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.crm-metric {
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  padding: 16px;
}
.crm-metric strong {
  display: block;
  font: 600 28px "Space Grotesk";
  color: var(--crm-accent);
}
.crm-metric span {
  font-size: 12px;
  color: #a1bac4;
}
.crm-empty {
  padding: 30px 10px;
  text-align: center;
  color: #9eb5bf;
}
.crm-confirm {
  border: 1px solid #c89c63;
  margin: 15px 0;
  padding: 16px;
  border-radius: 8px;
}
.crm-card input:focus,
.crm-card select:focus,
.crm-card textarea:focus {
  outline: 2px solid #46e6b3;
  outline-offset: 2px;
}
@media (max-width: 1100px) {
  .crm-layout {
    grid-template-columns: 1fr;
  }
  .crm-rule {
    align-items: stretch;
  }
  .crm-rule select {
    max-width: 100%;
  }
  .crm-card {
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #hub-pane-crm * {
    transition: none;
  }
}

.crm-test-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: #dce8ed;
  font-size: 14px;
  cursor: pointer;
}
.crm-test-toggle input {
  accent-color: var(--crm-accent);
}
