/* File path: admin/assets/admin.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    -apple-system,
    sans-serif;
  background: #f3f4f8;
  color: #23243a;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------------- Login ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.login-box h1 {
  font-size: 22px;
  margin-bottom: 6px;
}
.login-box p {
  color: #777;
  margin-bottom: 24px;
  font-size: 14px;
}
.login-box input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 14px;
}
.login-box button {
  width: 100%;
  padding: 12px;
  background: #5b4bff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.login-error {
  color: #dc3545;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ---------------- Topbar ---------------- */
.topbar {
  background: #1c1d2e;
  color: #fff;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-brand {
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-brand span.badge {
  background: #5b4bff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.topbar-actions a,
.topbar-actions button {
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.btn-preview {
  background: #2e2f45;
  color: #fff;
}
.btn-logout {
  background: transparent;
  color: #b6b7c9;
  border: 1px solid #3a3b54 !important;
}
.btn-save {
  background: #5b4bff;
  color: #fff;
}

/* ---------------- Layout ---------------- */
.layout {
  display: flex;
  max-width: 1300px;
  margin: 0 auto;
}
.sidenav {
  width: 220px;
  padding: 26px 16px;
  position: sticky;
  top: 60px;
  align-self: flex-start;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.sidenav a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: #55566e;
  margin-bottom: 2px;
  font-weight: 500;
}
.sidenav a:hover {
  background: #e9e9f5;
  color: #23243a;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 26px 30px 80px;
}

.flash {
  padding: 13px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}
.flash-success {
  background: #e5f8ec;
  color: #1f8a4c;
}
.flash-error {
  background: #fdeaea;
  color: #c0392b;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 40, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: #fff;
  border-radius: 14px;
  padding: 36px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e5f8ec;
  color: #1f8a4c;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.modal-icon-warn {
  background: #fff3d6;
  color: #92620a;
}
.modal-box h3 {
  margin: 0 0 10px;
  font-size: 18px;
}
.modal-box p {
  margin: 0 0 24px;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  flex: 1;
  text-align: center;
}
.btn-primary {
  background: #3b5bfd;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-primary:hover {
  background: #2f4bd6;
  text-decoration: none;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 26px 28px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  scroll-margin-top: 76px;
}
.card h2 {
  font-size: 18px;
  margin-bottom: 4px;
}
.card .card-desc {
  color: #777;
  font-size: 13px;
  margin-bottom: 20px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.field-grid-3col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #444;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dcdce6;
  border-radius: 7px;
  font-size: 14px;
  background: #fff;
}

/* Tag multi-select (Payment Types, GEO-Select Checkout) */
.tag-select {
  border: 1px solid #dcdce6;
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
}
.tag-select-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.tag-select-pills:empty {
  margin-bottom: 0;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eceef7;
  color: #23243a;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}
.tag-pill-remove {
  background: #d5d7e6;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  line-height: 1;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tag-pill-remove:hover {
  background: #c3c6dc;
}
.tag-select-add {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e5e5ef;
  border-radius: 6px;
  font-size: 13px;
  background: #fafafe;
}

/* Theme apply row */
.theme-apply-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 22px;
}
.theme-apply-row input[type="number"] {
  width: 90px;
  padding: 10px 12px;
  border: 1px solid #dcdce6;
  border-radius: 7px;
  font-size: 14px;
  background: #fff;
}
.theme-apply-row button {
  background: #23243a;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.theme-hint {
  font-size: 12px;
  color: #888;
  margin-top: -12px;
  margin-bottom: 20px;
}

.btn-secondary {
  background: #eceef7;
  color: #23243a;
  border: none;
  padding: 10px 18px;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.btn-secondary:hover {
  background: #dcdff0;
}

.save-preset-details {
  margin-top: 8px;
}
.save-preset-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #3b5bfd;
  margin-bottom: 12px;
}
.save-preset-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.save-preset-form input[type="text"],
.save-preset-form select {
  padding: 9px 12px;
  border: 1px solid #dcdce6;
  border-radius: 7px;
  font-size: 13px;
}
.save-preset-form input[type="text"] {
  flex: 1;
  min-width: 200px;
}

/* Template grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
/* minmax(0, 1fr) — not plain 1fr — so a long label or select can never
   stretch a column past its share and push the last one out of the card
   (behind the Live Preview panel). Name on top, the templates[...] key
   under it, and the dropdowns line up along the bottom of each row. */
.template-grid .field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.template-grid .field label {
  flex: 1;
  display: block;
  line-height: 1.3;
}
.template-grid .field label .hint {
  display: block;
  color: #999;
  font-weight: 400;
  font-size: 11px;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

/* Colors */
.color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.color-field {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-field label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: #444;
}
.color-field input[type="color"] {
  width: 42px;
  height: 38px;
  border: 1px solid #dcdce6;
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
}
.color-field input[type="text"] {
  width: 150px;
  padding: 9px 10px;
  border: 1px solid #dcdce6;
  border-radius: 7px;
  font-size: 13px;
}

/* Order list */
.order-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #e5e5f0;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fafafe;
}
.order-row.disabled {
  opacity: 0.55;
}
.order-row label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.order-row .move-btns {
  display: flex;
  gap: 4px;
}
.order-row .move-btns button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #dcdce6;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

/* Content preview select */
.content-field select {
  width: 100%;
}
.content-preview {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
}

.save-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 16px 28px;
  margin: 0 -30px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }
  .sidenav {
    display: none;
  }
  .field-grid,
  .field-grid-3col,
  .template-grid,
  .color-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   BUILD BUTTON
========================================================== */
.btn-build {
  background: #0d9c6a;
  color: #fff;
}
.btn-build-lg {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  margin-top: 6px;
}

/* ==========================================================
   MEDIA / IMAGE UPLOAD ROWS
========================================================== */
.media-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 0;
  border-bottom: 1px solid #eeeef6;
}
.media-row:last-of-type {
  border-bottom: none;
}
.media-thumb {
  width: 130px;
  height: 90px;
  flex-shrink: 0;
  border: 1px solid #e3e3ee;
  border-radius: 8px;
  background: #fafafe;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.media-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.media-empty {
  color: #aaa;
  font-size: 12px;
}

.stock-search-details {
  margin-top: 10px;
}
.stock-search-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #3b5bfd;
}
.stock-search-panel {
  margin-top: 10px;
}
.stock-search-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.stock-search-row .stock-keyword {
  flex: 1;
  min-width: 160px;
  padding: 8px 10px;
  border: 1px solid #dcdce6;
  border-radius: 6px;
  font-size: 13px;
}
.stock-search-row select {
  padding: 8px 10px;
  border: 1px solid #dcdce6;
  border-radius: 6px;
  font-size: 13px;
}
.stock-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}
.stock-result {
  position: relative;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  aspect-ratio: 4 / 3;
  background: #f2f2f7;
}
.stock-result:hover {
  border-color: #3b5bfd;
}
.stock-result img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.stock-result .stock-credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 9px;
  padding: 2px 4px;
  line-height: 1.2;
  opacity: 0;
  transition: opacity 0.15s;
}
.stock-result:hover .stock-credit {
  opacity: 1;
}
.stock-result.stock-picking {
  opacity: 0.5;
  pointer-events: none;
}
.stock-status {
  font-size: 12px;
  color: #888;
  padding: 6px 0;
}
.stock-status.stock-status-error {
  color: #c0392b;
}

.media-controls {
  flex: 1;
}
.media-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}
.media-source {
  font-size: 11px;
  font-weight: 500;
  color: #999;
  text-transform: none;
}
.media-note {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
}
.media-controls input[type="file"] {
  font-size: 13px;
}
.media-remove {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #c0392b;
  margin-top: 10px;
}
.media-path {
  font-size: 11px;
  color: #aaa;
  margin-top: 6px;
  font-family: monospace;
}

/* ==========================================================
   BUILD SUMMARY
========================================================== */
.build-summary {
  display: flex;
  gap: 32px;
  margin-bottom: 18px;
}
.build-summary div {
  display: flex;
  flex-direction: column;
}
.build-summary strong {
  font-size: 24px;
  color: #23243a;
}
.build-summary span {
  font-size: 12px;
  color: #888;
}
.build-warning {
  background: #fff6e5;
  border: 1px solid #ffe0a3;
  color: #8a6116;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.build-warning ul {
  margin: 8px 0 8px 18px;
}
.build-warning li {
  font-family: monospace;
  font-size: 12px;
}

/* ==========================================================
   LIVE PREVIEW PANEL
========================================================== */
.preview-panel {
  display: none;
}

.layout.preview-open {
  max-width: 100%;
}
.layout.preview-open .sidenav {
  display: none;
}
.layout.preview-open .content {
  max-width: 620px;
}
.layout.preview-open .template-grid,
.layout.preview-open .field-grid-3col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.layout.preview-open .color-grid {
  grid-template-columns: minmax(0, 1fr);
}
.layout.preview-open .preview-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  border-left: 1px solid #e3e3ee;
  background: #fff;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #eeeef6;
  background: #fafafe;
}
.preview-devices {
  display: flex;
  gap: 4px;
}
.device-btn {
  width: 34px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #dcdce6;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.device-btn.active {
  background: #5b4bff;
  color: #fff;
  border-color: #5b4bff;
}
.preview-status {
  flex: 1;
  font-size: 12px;
  color: #888;
}
.preview-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #dcdce6;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: #666;
}

.preview-frame-wrap {
  flex: 1;
  overflow: auto;
  background: #e9e9f2;
  display: flex;
  justify-content: center;
  padding: 0;
}
.preview-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}
.preview-frame-wrap.device-tablet {
  padding: 16px;
}
.preview-frame-wrap.device-tablet iframe {
  width: 768px;
  max-width: 100%;
}
.preview-frame-wrap.device-mobile {
  padding: 16px;
}
.preview-frame-wrap.device-mobile iframe {
  width: 390px;
  max-width: 100%;
}

.preview-note {
  font-size: 11px;
  color: #999;
  padding: 8px 16px;
  border-top: 1px solid #eeeef6;
  background: #fafafe;
}

@media (max-width: 1100px) {
  .layout.preview-open {
    flex-direction: column;
  }
  .layout.preview-open .content {
    max-width: 100%;
  }
  .layout.preview-open .preview-panel {
    position: static;
    height: 70vh;
    border-left: none;
    border-top: 1px solid #e3e3ee;
  }
  .layout.preview-open .template-grid,
  .layout.preview-open .field-grid-3col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .layout.preview-open .color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phones/small tablets: everything single-column, preview open or not.
   Has to come AFTER the <=1100px block above so it wins at equal specificity. */
@media (max-width: 900px) {
  .layout.preview-open .template-grid,
  .layout.preview-open .field-grid-3col,
  .layout.preview-open .color-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================
   DEVELOPER TEMPLATE MANAGER
========================================================== */
.dev-layout {
  max-width: 100%;
}

.dev-sidebar {
  width: 290px;
  flex-shrink: 0;
  padding: 20px 12px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid #e3e3ee;
  background: #fbfbfe;
}
.dev-sidebar-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #999;
  padding: 0 10px 10px;
}
.dev-section {
  margin-bottom: 4px;
}
.dev-section-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #44455e;
}
.dev-count {
  background: #e7e7f3;
  color: #6b6c85;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}
.dev-section.open .dev-section-name {
  color: #5b4bff;
}
.dev-variants {
  padding-left: 10px;
}
.dev-variant {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
  color: #6b6c85;
  margin-bottom: 2px;
}
.dev-variant:hover {
  background: #eeeefb;
  color: #23243a;
}
.dev-variant.active {
  background: #5b4bff;
  color: #fff;
}
.dev-variant.dev-empty {
  color: #bbb;
  font-style: italic;
  font-family: inherit;
}
.dev-live {
  background: #0d9c6a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.dev-variant.active .dev-live {
  background: rgba(255, 255, 255, 0.28);
}
.dev-mode-badge {
  background: #fff3d6;
  color: #92620a;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9px;
  margin-left: 4px;
  font-family: inherit;
}
.mode-toggle-form {
  margin: 0;
}
.mode-toggle-btn {
  border: none;
  border-radius: 7px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.mode-toggle-live {
  background: #e5f8ec;
  color: #1f8a4c;
}
.mode-toggle-live:hover {
  background: #d5f0e0;
}
.mode-toggle-development {
  background: #fff3d6;
  color: #92620a;
}
.mode-toggle-development:hover {
  background: #ffe9b8;
}
.dev-add-link {
  display: block;
  padding: 6px 10px;
  font-size: 12px;
  color: #5b4bff;
  font-weight: 600;
  border-radius: 6px;
}
.dev-add-link:hover {
  background: #eeeefb;
}

.dev-main {
  flex: 1;
  padding: 22px 26px 70px;
  min-width: 0;
}

/* Editor */
.editor-card {
  padding-bottom: 20px;
}
.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.editor-head h2 {
  margin-bottom: 6px;
}
.editor-path {
  font-size: 12px;
  color: #888;
  background: #f3f3fa;
  padding: 3px 8px;
  border-radius: 5px;
  font-family: ui-monospace, monospace;
}
.btn-danger {
  background: #fff;
  color: #c0392b;
  border: 1px solid #f0c7c2;
  padding: 9px 16px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.btn-danger:hover {
  background: #fdeaea;
}

.CodeMirror {
  border: 1px solid #d9d9e6;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.plain-editor {
  width: 100%;
  height: 62vh;
  padding: 14px;
  border: 1px solid #d9d9e6;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  background: #1f2130;
  color: #e6e6f0;
  resize: vertical;
  tab-size: 4;
}

.editor-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}
.editor-hint {
  font-size: 12px;
  color: #888;
}
.editor-save {
  padding: 11px 26px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

/* Add template form */
.field-note {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
  line-height: 1.4;
}
.field-note a {
  color: #3b5bfd;
}
.add-template-form .input-error {
  border-color: #dc3545;
  background: #fff7f7;
}

@media (max-width: 1000px) {
  .dev-layout {
    flex-direction: column;
  }
  .dev-sidebar {
    width: 100%;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e3e3ee;
  }
}

/* ==========================================================
   BUILD ACTIONS + FINISHED BUILDS LIST
========================================================== */
.build-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-build-alt {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 8px;
  border: 1px solid #0d9c6a;
  color: #0d9c6a;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
}
.btn-build-alt:hover {
  background: #eafaf3;
}

.past-builds {
  margin-top: 26px;
  border-top: 1px solid #eeeef6;
  padding-top: 18px;
}
.past-builds h4 {
  font-size: 14px;
  margin-bottom: 4px;
}
.past-build-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid #e5e5f0;
  border-radius: 8px;
  margin-top: 8px;
  background: #fafafe;
}
.past-build-row code {
  font-size: 12px;
  color: #55566e;
}
.btn-open-build {
  background: #5b4bff;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.editor-hint-warn {
  color: #8a6116;
}

/* ==========================================================
   EDITOR TABS (PHP / CSS / JS)
========================================================== */
.editor-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e3e3ee;
  margin-bottom: 14px;
}
.editor-tab {
  padding: 9px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
}
.editor-tab:hover {
  color: #44455e;
}
.editor-tab.active {
  color: #5b4bff;
  border-bottom-color: #5b4bff;
}
.tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0d9c6a;
  display: inline-block;
}

.editor-pane {
  display: none;
}
.editor-pane.active {
  display: block;
}
.editor-pane-hint {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
}
.editor-pane-hint code {
  background: #f3f3fa;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Sidebar asset indicators */
.dev-asset-dot {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: inherit;
}
.dev-asset-css {
  background: #2563eb;
}
.dev-asset-js {
  background: #d97706;
}

/* ==========================================================
   PREVIEW ERROR BOX
========================================================== */
.preview-error-box {
  background: #fdeaea;
  color: #7a2020;
  font-size: 12px;
  padding: 10px 16px;
  border-top: 1px solid #f0c7c2;
  line-height: 1.5;
}
.preview-error-box .preview-error-text {
  display: block;
  font-family: ui-monospace, monospace;
  margin: 4px 0;
  word-break: break-word;
  white-space: pre-wrap;
}
.preview-error-box a {
  color: #c0392b;
  font-weight: 600;
  text-decoration: underline;
}

.crm-provider-fields {
  background: #fafafe;
  border: 1px solid #eeeef6;
  border-radius: 8px;
  padding: 16px;
  margin-top: 8px;
}
.crm-provider-fields h4 {
  font-size: 14px;
  margin-bottom: 12px;
}

/* ---- Toggle switch (Checkout Security card's "Checkout Attempt Lockout") ---- */
.toggle-switch-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-switch-slider {
  position: absolute;
  inset: 0;
  background: #d7d7e3;
  border-radius: 999px;
  transition: background 0.15s;
}
.toggle-switch-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.toggle-switch input:checked + .toggle-switch-slider {
  background: #3b5bfd;
}
.toggle-switch input:checked + .toggle-switch-slider::before {
  transform: translateX(18px);
}
.toggle-switch input:focus-visible + .toggle-switch-slider {
  outline: 2px solid #3b5bfd;
  outline-offset: 2px;
}

/* ---- Theme & Templates: sections the active theme has no template for ---- */
.tpl-field-missing select {
  opacity: 0.55;
  cursor: not-allowed;
}
.tpl-missing-note {
  margin-top: 5px;
  font-size: 12px;
  color: #b45309;
}
.order-row.theme-missing {
  opacity: 0.6;
}
.order-row.theme-missing input[type="checkbox"] {
  cursor: not-allowed;
}
.order-missing-note {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #b45309;
}

/* ---- Payment Icons card ---- */
.req-note { color: #dc2626; font-weight: 700; }
.pay-matrix-wrap { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 10px; }
.pay-matrix { width: 100%; border-collapse: collapse; min-width: 560px; }
.pay-matrix th,
.pay-matrix td { padding: 14px 18px; text-align: left; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
.pay-matrix th { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #6b7280; background: #fff; }
.pay-matrix tbody tr:nth-child(odd) td { background: #f7f8fa; }
.pay-matrix th.is-active,
.pay-matrix td.is-active { box-shadow: inset 0 -2px 0 transparent; background: #eef2ff !important; }
.pay-matrix tbody tr:last-child td { border-bottom: 0; }
.pay-matrix label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #374151; }
.pay-matrix-icon { height: 28px; width: auto; display: block; }
.multi-dropdown { position: relative; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
.multi-dropdown > summary { list-style: none; cursor: pointer; padding: 10px 36px 10px 12px; font-size: 14px; position: relative; }
.multi-dropdown > summary::-webkit-details-marker { display: none; }
.multi-dropdown > summary::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 2px solid #6b7280; border-bottom: 2px solid #6b7280; transform: translateY(-70%) rotate(45deg); }
.multi-dropdown[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.multi-dropdown-list { border-top: 1px solid #e5e7eb; padding: 6px 4px; }
.multi-dropdown-list label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 14px; cursor: pointer; border-radius: 6px; }
.multi-dropdown-list label:hover { background: #f3f4f6; }
.multi-dropdown-list label.is-locked { cursor: default; color: #6b7280; }
.multi-dropdown-list .hint { margin-left: auto; font-size: 11px; }
