/* Inactivity loyalty rules */
.inactivity-page {
  max-width: 1680px;
  width: min(1680px, 98vw);
}

.inactivity-layout {
  grid-template-columns: minmax(360px, .48fr) minmax(0, 1fr);
  align-items: start;
}

.inactivity-hero {
  background:
    radial-gradient(circle at 85% 10%, rgba(245,158,11,.16), transparent 32%),
    linear-gradient(135deg, rgba(15,127,85,.10), #fff);
}

.inactivity-form-panel {
  position: sticky;
  top: 18px;
}

.rule-preview-box {
  padding: 14px 16px;
  border-radius: 20px;
  background: #fff7ed;
  color: #92400e;
  border: 1px solid rgba(245,158,11,.20);
  font-weight: 900;
}

.inactivity-rules-list {
  display: grid;
  gap: 14px;
}

.inactivity-rule-card {
  padding: 16px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15,23,42,.06);
}

.inactivity-rule-card.is-active {
  border-color: rgba(15,127,85,.18);
  background:
    radial-gradient(circle at 100% 0%, rgba(15,127,85,.10), transparent 34%),
    #fff;
}

.rule-card-head,
.rule-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.rule-card-head h3 {
  margin: 0 0 5px;
}

.rule-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.rule-metrics div {
  padding: 10px;
  border-radius: 16px;
  background: #f8fafc;
}

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

.rule-metrics strong {
  color: #0f172a;
  font-size: 1.15rem;
}

.rule-metrics span {
  color: #64748b;
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rule-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.rule-tags span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 900;
  font-size: .78rem;
}

.rule-run-history {
  display: grid;
  gap: 10px;
}

.rule-run-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: #f8fafc;
}

.rule-run-card strong,
.rule-run-card small {
  display: block;
}

.rule-run-card small {
  color: #64748b;
}

.rule-run-card b {
  color: #b45309;
}

.inactivity-preview-table small {
  display: block;
  color: #64748b;
}

.btn-danger {
  background: #dc2626 !important;
  color: #fff !important;
}

@media (max-width: 1100px) {
  .inactivity-layout {
    grid-template-columns: 1fr;
  }

  .inactivity-form-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  .rule-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rule-card-head,
  .rule-actions {
    display: grid;
  }

  .rule-actions .btn {
    width: 100%;
  }
}
