/* =========================================================
   EVENT COUNTRY — TOUR FACTORY AUTOPILOT v2
========================================================= */
.tfa-panel {
  margin-bottom: 12px;
  border-color: #ffd1bc !important;
  background: linear-gradient(135deg, #ffffff 0%, #fffaf7 100%) !important;
}

.tfa-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.tfa-panel-head h2 {
  margin: 0;
  color: #101828;
  font-size: 20px;
}

.tfa-panel-head p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 11px;
  line-height: 1.5;
}

.tfa-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 10px;
  text-transform: uppercase;
}

.tfa-state span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.tfa-state.enabled {
  color: #067647;
  background: #ecfdf3;
  border-color: #abefc6;
}

.tfa-state.enabled span {
  background: #12b76a;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, .13);
}

.tfa-state.paused {
  color: #b54708;
  background: #fffaeb;
  border-color: #fedf89;
}

.tfa-state.paused span {
  background: #f79009;
  box-shadow: 0 0 0 4px rgba(247, 144, 9, .13);
}

.tfa-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 11px;
}

.tfa-metrics > div {
  padding: 10px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 4px;
}

.tfa-metrics span,
.tfa-metrics strong {
  display: block;
}

.tfa-metrics span {
  color: #667085;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tfa-metrics strong {
  margin-top: 3px;
  color: #101828;
  font-size: 17px;
}

.tfa-explanation {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 11px;
  padding: 11px;
  color: #344054;
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  border-radius: 4px;
}

.tfa-explanation > span {
  color: #ff5001;
}

.tfa-explanation strong,
.tfa-explanation p {
  display: block;
}

.tfa-explanation strong {
  color: #101828;
  font-size: 11px;
}

.tfa-explanation p {
  margin: 2px 0 0;
  color: #667085;
  font-size: 10px;
  line-height: 1.45;
}

.tfa-config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.tfa-switch-card,
.tfa-check-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  cursor: pointer;
}

.tfa-switch-card {
  grid-column: span 2;
}

.tfa-switch-card input,
.tfa-check-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tfa-switch {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 22px;
  background: #d0d5dd;
  border-radius: 999px;
  transition: background .2s ease;
}

.tfa-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .25);
  transition: transform .2s ease;
}

.tfa-switch-card input:checked + .tfa-switch {
  background: #ff5001;
}

.tfa-switch-card input:checked + .tfa-switch::after {
  transform: translateX(16px);
}

.tfa-switch-card strong,
.tfa-switch-card small,
.tfa-check-card strong,
.tfa-check-card small {
  display: block;
}

.tfa-switch-card strong,
.tfa-check-card strong {
  color: #101828;
  font-size: 11px;
}

.tfa-switch-card small,
.tfa-check-card small {
  margin-top: 2px;
  color: #667085;
  font-size: 9px;
  line-height: 1.4;
}

.tfa-check-card {
  grid-column: span 2;
}

.tfa-check-card input {
  position: static;
  width: 18px;
  height: 18px;
  opacity: 1;
  pointer-events: auto;
  accent-color: #ff5001;
}

.tfa-strategy {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 11px;
}

.tfa-strategy > div {
  padding: 10px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 4px;
}

.tfa-strategy .material-icons-outlined {
  color: #ff5001;
  font-size: 20px;
}

.tfa-strategy strong,
.tfa-strategy p {
  display: block;
}

.tfa-strategy strong {
  margin-top: 4px;
  color: #101828;
  font-size: 11px;
}

.tfa-strategy p {
  margin: 3px 0 0;
  color: #667085;
  font-size: 9px;
  line-height: 1.45;
}

.tfa-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid #e4e7ec;
}

.tfa-trusted {
  margin-top: 11px;
  padding: 10px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 4px;
}

.tfa-trusted summary {
  color: #344054;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.tfa-region-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
  margin-top: 9px;
}

.tfa-region-grid > div {
  padding: 7px;
  border: 1px solid;
  border-radius: 4px;
}

.tfa-region-grid span,
.tfa-region-grid strong {
  display: block;
}

.tfa-region-grid span {
  min-height: 25px;
  font-size: 8px;
  line-height: 1.3;
}

.tfa-region-grid strong {
  margin-top: 3px;
  font-size: 15px;
}

.tfa-region-grid .ready {
  color: #067647;
  background: #ecfdf3;
  border-color: #abefc6;
}

.tfa-region-grid .low {
  color: #b54708;
  background: #fffaeb;
  border-color: #fedf89;
}

.tfa-trusted > p {
  margin: 8px 0 0;
  color: #667085;
  font-size: 9px;
  line-height: 1.45;
}

.tfa-toast {
  position: fixed;
  z-index: 999999;
  right: 18px;
  bottom: 18px;
  max-width: min(460px, calc(100vw - 36px));
  padding: 12px 15px;
  color: #fff;
  background: #067647;
  border-radius: 4px;
  box-shadow: 0 15px 40px rgba(16, 24, 40, .25);
  font-weight: 800;
}

.tfa-toast.error {
  background: #b42318;
}

@media (max-width: 1200px) {
  .tfa-config-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tfa-metrics {
    grid-template-columns: repeat(3, 1fr);
  }
  .tfa-region-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 800px) {
  .tfa-panel-head {
    flex-direction: column;
  }
  .tfa-config-grid,
  .tfa-strategy {
    grid-template-columns: 1fr 1fr;
  }
  .tfa-switch-card,
  .tfa-check-card,
  .tf-field-wide {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  .tfa-config-grid,
  .tfa-strategy,
  .tfa-metrics,
  .tfa-region-grid {
    grid-template-columns: 1fr;
  }
  .tfa-switch-card,
  .tfa-check-card,
  .tf-field-wide {
    grid-column: auto;
  }
  .tfa-actions .btn {
    width: 100%;
  }
}
