/* Aura Builder — Templates admin library */
.ab-tpl-wrap { max-width: 1200px; }
.ab-tpl-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}
.ab-tpl-wizard-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ab-tpl-wizard-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font: 600 13px system-ui, sans-serif;
  color: #1d2327;
}
.ab-tpl-wizard-field select,
.ab-tpl-wizard-field input[type="text"] {
  font-weight: 400;
  max-width: 100%;
}
.ab-tpl-wizard-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 400 13px system-ui, sans-serif;
}
.ab-tpl-modal__panel--wide {
  width: min(560px, 100%);
}
.ab-tpl-intro {
  color: #646970;
  max-width: 70ch;
  margin: 8px 0 20px;
  line-height: 1.55;
}
.ab-tpl-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ab-tpl-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ab-tpl-tab {
  appearance: none;
  border: 1px solid #c3c4c7;
  background: #fff;
  color: #1d2327;
  border-radius: 999px;
  padding: 6px 14px;
  font: 600 13px/1.3 system-ui, sans-serif;
  cursor: pointer;
}
.ab-tpl-tab span {
  display: inline-block;
  margin-left: 6px;
  background: #f0f0f1;
  color: #50575e;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
}
.ab-tpl-tab.is-active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}
.ab-tpl-tab.is-active span {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.ab-tpl-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ab-tpl-search {
  min-width: 200px;
}
.ab-tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.ab-tpl-card {
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}
.ab-tpl-card__thumb {
  height: 140px;
  background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 50%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c3aed;
  font: 700 28px/1 system-ui, sans-serif;
  letter-spacing: -0.03em;
  overflow: hidden;
  position: relative;
}
.ab-tpl-card__thumb--kit {
  background: linear-gradient(135deg, #0f172a 0%, #4c1d95 60%, #7c3aed 100%);
  color: #fff;
}
.ab-tpl-card__thumb--img {
  background: #e2e8f0;
  padding: 0;
}
.ab-tpl-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
/* CSS wireframe fallbacks (when SVG missing) */
.ab-tpl-wire {
  width: 100%;
  height: 100%;
  background: #f1f5f9;
  position: relative;
}
.ab-tpl-wire--hero {
  background: linear-gradient(135deg, #4c1d95, #7c3aed);
}
.ab-tpl-wire--hero::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  top: 38%;
  height: 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 0 0 rgba(255, 255, 255, 0.35), 0 48px 0 -20px #c4b5fd;
}
.ab-tpl-wire--features {
  background: #f8fafc;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 18px 14px;
  box-sizing: border-box;
}
.ab-tpl-wire--features::before,
.ab-tpl-wire--features::after {
  content: "";
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.ab-tpl-wire--cta {
  background: #7c3aed;
}
.ab-tpl-wire--header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.ab-tpl-wire--footer {
  background: #0f172a;
}
.ab-tpl-wire--page,
.ab-tpl-wire--section,
.ab-tpl-wire--kit {
  background: linear-gradient(#7c3aed 0 36%, #f8fafc 36% 100%);
}
.ab-tpl-wire--kit-restaurant {
  background: linear-gradient(#9a3412 0 40%, #fff7ed 40% 100%);
}
.ab-tpl-wire--kit-portfolio {
  background: linear-gradient(#0f172a 0 28%, #312e81 28% 48%, #0f172a 48% 100%);
}
.ab-tpl-wire--kit-realestate {
  background: linear-gradient(#047857 0 36%, #f0fdf4 36% 100%);
}
.ab-tpl-card__body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ab-tpl-card__name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.ab-tpl-card__meta {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ab-tpl-badge {
  display: inline-block;
  font: 700 10px/1 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}
.ab-tpl-badge--core {
  background: #ede9fe;
  color: #5b21b6;
}
.ab-tpl-badge--user {
  background: #ecfdf5;
  color: #047857;
}
.ab-tpl-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}
.ab-tpl-empty,
.ab-tpl-loading,
.ab-tpl-error {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: #646970;
  background: #fff;
  border: 1px dashed #c3c4c7;
  border-radius: 10px;
}
.ab-tpl-error { color: #b91c1c; border-color: #fecaca; }

/* Modal */
.ab-tpl-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ab-tpl-modal[hidden] { display: none !important; }
.ab-tpl-modal__panel {
  background: #fff;
  border-radius: 12px;
  width: min(480px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px 24px 18px;
  position: relative;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.ab-tpl-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}
.ab-tpl-modal__desc {
  color: #64748b;
  margin: 0 0 14px;
  font-size: 13px;
}
.ab-tpl-modal__body label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 13px;
}
.ab-tpl-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}
.ab-tpl-modal__status {
  margin: 10px 0 0;
  font-size: 13px;
}
.ab-tpl-modal__status.is-ok { color: #047857; }
.ab-tpl-modal__status.is-err { color: #b91c1c; }
