/* Admin Settings — Communications page
   Tight single-row layout with toggle switches replacing big buttons.
   Mobile overrides are appended at the bottom of THIS file so Propshaft
   loads them with their base rules. */

.as-shell {
  max-width: 880px;
}

/* [WG6] Grouped layout — sticky in-page nav + group headings. */
.as-shell--grouped {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 28px;
  align-items: start;
  max-width: none;
}
.as-nav {
  position: sticky;
  top: 82px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
}
.as-nav__link {
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  line-height: 1.3;
}
.as-nav__link:hover {
  color: var(--text-1);
  background: var(--surface-hi);
}
.as-group {
  margin: 0 0 36px;
}
.as-group:last-child {
  margin-bottom: 0;
}
.as-group__title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-bottom: 6px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.as-section {
  margin: 0 0 28px;
}
.as-section__header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border-lo);
  margin-bottom: 14px;
}
.as-section__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
}
.as-section__sub {
  font-size: 12px;
  color: var(--text-3);
}

.as-voice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}
.as-voice__intro {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.45;
  margin: 0 0 14px;
}
.as-voice__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.as-voice__greeting {
  grid-column: 1 / -1;
}
.as-voice__excluded-sellers {
  grid-column: 1 / -1;
}
.as-voice__field label,
.as-voice__field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.as-voice__field .form-control {
  font-size: 13px;
}
.as-voice__hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}
.as-voice__fixed-provider {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  font-size: 12px;
  color: var(--text-2);
}
.as-voice__checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.as-voice__checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}
.as-voice__checkbox-option input {
  margin: 0;
}
.as-voice__actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border-lo);
}

.as-voice__field .as-scheduling-channel-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin: 8px 8px 0 0;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
  white-space: nowrap;
}
.as-voice__field .as-scheduling-channel-option + .as-scheduling-channel-option {
  margin-top: 8px;
}
.as-voice__field .as-scheduling-channel-option input {
  margin: 0;
}
.as-scheduling-matrix {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-lo);
}
.as-scheduling-matrix__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.as-scheduling-matrix__table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
}
.as-scheduling-matrix__table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 12px;
}
.as-scheduling-matrix__table th,
.as-scheduling-matrix__table td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}
.as-scheduling-matrix__table th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface);
  border-bottom: 1px solid var(--border-lo);
}
.as-scheduling-matrix__table td {
  border-top: 1px solid var(--border-lo);
  color: var(--text-2);
}
.as-scheduling-matrix__table tbody tr:first-child td {
  border-top: 0;
}
.as-scheduling-matrix__salesperson {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
}
.as-scheduling-matrix__option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}
.as-scheduling-matrix__option input {
  margin: 0;
}

.as-ai-voice-log {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-lo);
}
.as-ai-voice-webhook {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
}
.as-ai-voice-warning-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}
.as-ai-voice-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 3px solid var(--warning);
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.08);
  color: #92400e;
  font-size: 12px;
  line-height: 1.35;
}
.as-ai-voice-warning i {
  color: var(--warning-text);
  margin-top: 2px;
}
.as-ai-voice-readiness {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.as-ai-voice-readiness__pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.as-ai-voice-readiness__pill.is-ready {
  border-color: rgba(35, 126, 73, 0.25);
  background: rgba(35, 126, 73, 0.1);
  color: #237e49;
}
.as-ai-voice-readiness__pill.is-missing {
  border-color: rgba(184, 121, 31, 0.28);
  background: rgba(184, 121, 31, 0.1);
  color: #8f5e19;
}
.as-ai-voice-log__head,
.as-ai-voice-log__row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.as-ai-voice-log__head {
  justify-content: space-between;
  margin-bottom: 10px;
}
.as-ai-voice-log__counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.as-ai-voice-log__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
}
.as-ai-voice-log__rows {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.as-ai-voice-log__row {
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 10px 12px;
  border-top: 1px solid var(--border-lo);
  background: var(--surface-hi);
}
.as-ai-voice-log__row:first-child {
  border-top: 0;
}
.as-ai-voice-log__job,
.as-ai-voice-log__meta,
.as-ai-voice-log__time {
  min-width: 0;
}
.as-ai-voice-log__job {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-3);
}
.as-ai-voice-log__link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-1);
  text-decoration: none;
}
.as-ai-voice-log__link:hover {
  color: var(--brass-lo);
}
.as-ai-voice-log__inline-link {
  color: var(--brass-lo);
  font-weight: 700;
  text-decoration: none;
}
.as-ai-voice-log__inline-link:hover {
  text-decoration: underline;
}
.as-ai-voice-log__meta {
  flex: 1;
  font-size: 12px;
  color: var(--text-2);
}
.as-ai-voice-log__next {
  flex: 1.2;
  min-width: 220px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}
.as-ai-voice-log__next strong {
  color: var(--text-1);
}
.as-ai-voice-log__time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  text-align: right;
}
.as-ai-voice-log__details {
  flex: 0 0 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-lo);
  font-size: 12px;
  color: var(--text-2);
}
.as-ai-voice-log__details summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.as-ai-voice-log__details p {
  margin: 8px 0 0;
}
.as-ai-voice-log__details pre {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface);
  white-space: pre-wrap;
}
.as-ai-voice-log__empty {
  padding: 18px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  color: var(--text-3);
  text-align: center;
  font-size: 12px;
}

.as-master {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--danger);
  border-radius: var(--r-lg);
  margin-bottom: 22px;
}
.as-master.is-on {
  border-left-color: var(--success, #16a34a);
}
.as-master__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.as-master.is-on .as-master__icon {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success, #16a34a);
}
.as-master__body {
  flex: 1;
  min-width: 0;
}
.as-master__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}
.as-master__sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.as-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.as-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-lo);
}
.as-row:first-child {
  border-top: 0;
}
.as-row__body {
  flex: 1;
  min-width: 0;
}
.as-row__label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.25;
}
.as-row__desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.4;
}
.as-row__fires {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.as-row__badge {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-hi);
  color: var(--text-3);
  margin-left: 6px;
  vertical-align: middle;
}
.as-row__badge--soon {
  color: #b45309;
  background: #fffbeb;
}

.as-switch {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
}
.as-switch form,
.as-switch.button_to {
  margin: 0;
  padding: 0;
  display: inline-flex;
}
.as-switch__btn {
  appearance: none;
  -webkit-appearance: none;
  background: var(--border);
  border: 0;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.18s ease;
  outline: none;
  padding: 0;
  font: 0/0 a;
  color: transparent;
}
.as-switch__btn::after {
  content: "";
  position: absolute;
  inset: -10px;
}
.as-switch__btn::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.as-switch--on .as-switch__btn {
  background: var(--brass);
}
.as-switch--on .as-switch__btn::before {
  transform: translateX(20px);
}
.as-switch__btn:hover {
  filter: brightness(0.95);
}
.as-switch__btn:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
.as-switch--disabled .as-switch__btn {
  opacity: 0.5;
  cursor: not-allowed;
}
.as-switch__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-3);
  min-width: 24px;
  text-align: right;
}
.as-switch--on .as-switch__label {
  color: var(--brass-lo);
}

/* [WG6/D9] Cadence panel — read-only, values sourced live from the
   OutreachSweepJob + Sms constants passed in via the controller/view. */
.as-cadence {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-lo);
}
.as-cadence__item {
  padding: 10px 12px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
}
.as-cadence__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}
.as-cadence__value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.35;
}

/* [WG6] Auto-scheduling roster — read-only; per-channel checkboxes above stay
   the write path. */
.as-roster {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-lo);
}
.as-roster__table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
}
.as-roster__table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 12px;
}
.as-roster__table th,
.as-roster__table td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}
.as-roster__table th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface);
  border-bottom: 1px solid var(--border-lo);
}
.as-roster__table td {
  border-top: 1px solid var(--border-lo);
  color: var(--text-2);
}
.as-roster__table tbody tr:first-child td {
  border-top: 0;
}
.as-roster__name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
}
.as-roster__badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--border);
}
.as-roster__badge--on {
  color: #237e49;
  background: rgba(35, 126, 73, 0.1);
  border-color: rgba(35, 126, 73, 0.25);
}
.as-roster__badge--off {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.22);
}
.as-roster__excluded {
  font-size: 11.5px;
  color: var(--text-3);
}

/* [WG6] "Where the triggers live" static reference card. */
.as-triggers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.as-triggers__card {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.as-triggers__where {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.as-triggers__where a {
  color: var(--brass-lo);
  text-decoration: none;
}
.as-triggers__where a:hover {
  text-decoration: underline;
}
.as-triggers__list {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .as-voice__grid {
    grid-template-columns: 1fr;
  }
  .as-scheduling-matrix__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .as-scheduling-matrix__table {
    min-width: 500px;
  }
  .as-row {
    padding: 12px 14px;
  }
  .as-ai-voice-log__row {
    align-items: flex-start;
    flex-direction: column;
  }
  .as-ai-voice-log__time {
    text-align: left;
  }
  .as-shell--grouped {
    grid-template-columns: 1fr;
  }
  .as-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0 0 8px;
  }
  .as-roster__table {
    min-width: 420px;
  }
}
