/*
Jury Marketing - Step 12, the Settings workspace layout. Purely
additive: new jm-set-* classes only, reusing every existing token/
component class from tokens.css/components.css/dashboard.css and the
shared jm-modal-* component already defined in clients.css (loaded on
every page) - same discipline as every prior workspace this session.
*/

.jm-set-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--jm-space-3);
  margin: var(--jm-space-6) 0 var(--jm-space-1);
}

.jm-set-section-title {
  font-size: var(--jm-fs-md);
  font-weight: var(--jm-fw-bold);
  color: var(--jm-text);
  margin: var(--jm-space-6) 0 var(--jm-space-1);
}

.jm-set-section-header .jm-set-section-title {
  margin: 0;
}

.jm-set-section-subtitle {
  font-size: var(--jm-fs-sm);
  color: var(--jm-text-muted);
  margin: 0 0 var(--jm-space-4);
}

/* --- Automation Rules --- */

.jm-set-automation-row {
  align-items: flex-start;
  flex-wrap: wrap;
}

.jm-set-automation-main {
  flex: 1;
  min-width: 220px;
}

.jm-set-automation-actions {
  display: flex;
  align-items: center;
  gap: var(--jm-space-3);
  flex-wrap: wrap;
}

.jm-set-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: var(--jm-space-2);
  font-size: var(--jm-fs-sm);
  color: var(--jm-text);
  white-space: nowrap;
}

/* --- Pricing Configuration --- */

.jm-set-pricing-subheading {
  font-size: var(--jm-fs-sm);
  font-weight: var(--jm-fw-semibold);
  color: var(--jm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--jm-space-2);
}

.jm-set-pricing-row {
  gap: var(--jm-space-4);
}

.jm-set-pricing-label-input {
  flex: 1;
  min-width: 0;
}

.jm-set-pricing-weight-field {
  display: flex;
  align-items: center;
  gap: var(--jm-space-2);
  width: 110px;
  flex-shrink: 0;
  color: var(--jm-text-muted);
}
.jm-set-pricing-weight-field .jm-input {
  width: 80px;
}

.jm-set-tier-row {
  flex-wrap: wrap;
  gap: var(--jm-space-4);
}

.jm-set-tier-field {
  display: flex;
  flex-direction: column;
  gap: var(--jm-space-1);
}

.jm-set-tier-range {
  display: flex;
  align-items: center;
  gap: var(--jm-space-2);
  color: var(--jm-text-muted);
}
.jm-set-tier-range .jm-input {
  width: 90px;
}

.jm-set-min-fee-row {
  display: flex;
  align-items: center;
  gap: var(--jm-space-2);
  color: var(--jm-text-muted);
}
.jm-set-min-fee-row .jm-input {
  width: 140px;
}

/* --- Business App Connections --- */

.jm-set-integration-row {
  align-items: flex-start;
}

.jm-set-integration-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--jm-space-1);
}

.jm-set-integration-main .jm-row-title {
  display: flex;
  align-items: center;
  gap: var(--jm-space-3);
  flex-wrap: wrap;
}

.jm-set-integration-error {
  color: var(--jm-danger, #c0392b);
}

.jm-set-integration-main code {
  font-family: var(--jm-font-mono, monospace);
  font-size: var(--jm-fs-xs);
  background: var(--jm-bg);
  border: 1px solid var(--jm-border);
  border-radius: 3px;
  padding: 1px 5px;
}

.jm-set-planned-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--jm-space-2);
}

/* --- Onboarding Package --- */

.jm-set-onboarding-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--jm-space-3);
}

/* --- Connection --- */

.jm-set-connection-row {
  display: flex;
  align-items: center;
  gap: var(--jm-space-3);
  margin-bottom: var(--jm-space-4);
}

@media (max-width: 900px) {
  .jm-set-section-header {
    flex-direction: column;
    align-items: stretch;
  }
  .jm-set-section-header .jm-btn,
  .jm-dash-header-actions .jm-btn {
    width: 100%;
    height: var(--jm-touch-target);
  }
  .jm-set-automation-row {
    flex-direction: column;
    align-items: stretch;
  }
  .jm-set-automation-actions {
    justify-content: space-between;
  }
  .jm-set-automation-actions .jm-btn {
    height: var(--jm-touch-target);
  }
  .jm-set-tier-row {
    flex-direction: column;
    align-items: stretch;
  }
  .jm-set-pricing-row {
    flex-direction: column;
    align-items: stretch;
  }
  .jm-set-pricing-weight-field {
    width: 100%;
  }
}
