/* static/css/tervia-templates.css */

.page-title {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: #17210f;
}

.templates-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 22px;
  margin-top: 18px;
}

.templates-hero-content,
.templates-summary-card,
.templates-toolbar,
.templates-side-panel .panel,
.template-card {
  border: 1px solid rgba(58, 102, 0, 0.12);
  background: linear-gradient(135deg, #fbfff5 0%, #ffffff 58%, #f4f8ed 100%);
  border-radius: 30px;
  box-shadow: 0 24px 70px rgba(37, 54, 20, 0.08);
}

.templates-hero-content {
  padding: 34px;
}

.templates-summary-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  padding: 28px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.summary-value {
  font-size: 34px;
  font-weight: 700;
  color: #263719;
}

.summary-label {
  font-size: 13px;
  color: #78836f;
}

.summary-divider {
  width: 1px;
  height: 48px;
  background: rgba(58, 102, 0, 0.12);
}

.templates-toolbar {
  margin-top: 22px;
  padding: 16px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
}

.templates-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(58, 102, 0, 0.12);
}

.templates-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
}

.templates-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(58, 102, 0, 0.12);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip.active {
  background: #edf7df;
  color: #2f5200;
}

.templates-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  margin-top: 22px;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.template-card {
  padding: 22px;
}

.template-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.template-icon {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #edf7df;
  color: #3a6600;
}

.template-type {
  padding: 8px 12px;
  border-radius: 999px;
  background: #f5f7f2;
  font-size: 12px;
  font-weight: 700;
  color: #64705b;
}

.template-title {
  margin: 18px 0 8px;
  font-size: 18px;
  color: #17210f;
}

.template-description {
  font-size: 14px;
  line-height: 1.6;
  color: #78836f;
}

.template-meta {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: #7a8573;
}

.template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.template-tag {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f4f1;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.template-tag.success {
  background: #edf7df;
  color: #3a6600;
}

.template-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.template-btn {
  flex: 1;
  height: 40px;
  border-radius: 14px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.template-btn.primary {
  background: #3a6600;
  color: #fff;
}

.template-btn.secondary {
  background: #edf7df;
  color: #3a6600;
}

.templates-side-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.ai-panel,
.recommendation-panel {
  padding: 24px;
}

.ai-panel-icon {
  width: 54px;
  height: 54px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: #edf7df;
  color: #3a6600;
  margin-bottom: 18px;
}

.side-title {
  margin: 0;
  font-size: 18px;
  color: #17210f;
}

.side-text {
  margin: 10px 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #78836f;
}

.side-btn {
  width: 100%;
  justify-content: center;
}

.recommendation-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.recommendation-item {
  display: flex;
  gap: 12px;
}

.recommendation-item span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #edf7df;
  color: #3a6600;
  font-size: 13px;
  font-weight: 700;
}

.recommendation-item strong {
  display: block;
  font-size: 14px;
  color: #17210f;
}

.recommendation-item p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #78836f;
}

.new-template-btn {
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: #3a6600;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 1180px) {
  .templates-hero,
  .templates-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {

  .templates-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .templates-summary-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .summary-divider {
    width: 100%;
    height: 1px;
  }

  .template-actions {
    flex-direction: column;
  }
}