.company-automation-templates {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.company-automation-templates-head,
.company-automation-template-list article,
.company-automation-template-pagination {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.company-automation-templates h3,
.company-automation-templates h4,
.company-automation-template-list p {
  margin: 0;
}

.company-automation-templates-head p,
.company-automation-template-list p,
.company-automation-template-loading {
  margin: 5px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.company-automation-template-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.company-automation-template-form label,
.company-automation-template-form .wide {
  display: grid;
  gap: 6px;
}

.company-automation-template-filter {
  display: grid;
  grid-template-columns: minmax(0, 240px);
  gap: 6px;
}

.company-automation-template-filter select {
  width: 100%;
}

.company-automation-template-form .wide {
  grid-column: 1 / -1;
}

.company-automation-template-form textarea {
  min-height: 108px;
  resize: vertical;
}

.company-automation-template-form input,
.company-automation-template-form textarea {
  width: 100%;
  box-sizing: border-box;
}

.company-automation-template-list {
  display: grid;
  gap: 8px;
}

.company-automation-template-list article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.company-automation-template-list article > span {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  text-align: right;
}

.company-automation-template-pagination {
  justify-content: flex-start;
  margin: 0;
}

[data-theme="dark"] .company-automation-template-form input,
[data-theme="dark"] .company-automation-template-form textarea,
[data-theme="dark"] .company-automation-template-filter select {
  background: var(--panel);
  color: var(--ink);
}

@media (max-width: 720px) {
  .company-automation-templates-head,
  .company-automation-template-list article {
    flex-direction: column;
  }

  .company-automation-templates-head > button,
  .company-automation-template-list article > span {
    width: 100%;
  }

  .company-automation-template-list article > span {
    justify-content: flex-start;
    text-align: left;
  }

  .company-automation-template-form {
    grid-template-columns: 1fr;
  }
}
