.admin-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.editor-main {
  width: 800px;
  flex: 0 0 auto;
}

/* =============================
   CANVAS
============================= */

.editor-canvas {
  position: relative;
  width: 100%;
  border: 1px solid #ddd;
  background: #f8f8f8;
}

.canvas-image {
  width: 100%;
  display: block;
}

.canvas-placeholder {
  padding: 120px;
  text-align: center;
  color: #777;
}

.text-layer {
  position: absolute;
  cursor: move;

  padding: 6px 12px;

  border: 1px dashed rgba(0,0,0,0.4);
  background: rgba(255,255,255,0.7);

  font-weight: bold;

  max-width: 60%;
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: clip;
  line-height: 1.2;
  font-family: "Open Sans";
}

.text-layer.active {
  border: 2px solid var(--color-green-dark);
  background: rgba(31, 122, 63, 0.15);
}

/* =============================
   PREVIEW (BELOW CANVAS)
============================= */

.editor-preview {
  width: 100%;
}

.preview-card {
  position: relative;
  border: 1px solid #ddd;
  background: #fff;
}

.preview-image {
  width: 100%;
  display: block;
}

/* =============================
   PREVIEW SPINNER
============================= */

.preview-image-wrapper {
  position: relative;
}

.preview-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
}

.preview-spinner-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #555;
  animation: preview-bounce 1s ease-in-out infinite;
}

.preview-spinner-dot:nth-child(2) { animation-delay: 0.15s; }
.preview-spinner-dot:nth-child(3) { animation-delay: 0.30s; }

@keyframes preview-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1;   }
}

.preview-layer {
  position: absolute;

  border: none;
  background: transparent;
  padding: 0;

  font-weight: bold;

  pointer-events: none;

  max-width: 60%;
  white-space: nowrap;
  word-break: normal;
  line-height: 1.2;
  font-family: "Open Sans";
}

/* =============================
   SIDEBAR
============================= */

.editor-sidebar {
  width: 320px;
  max-height: 90vh;
  overflow-y: auto;
  position: sticky;
  top: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.field-settings {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
  display: none;
}

.field-settings.active {
  display: block;
}

.field-settings h4 {
  margin-bottom: 8px;
}

.field-settings label {
  display: block;
  font-size: 12px;
  margin-top: 6px;
}

.field-settings input,
.field-settings select {
  width: 100%;
  padding: 6px;
  margin-top: 2px;
}

.actions {
  margin-top: 20px;
}

.btn-primary {
  width: 100%;
  padding: 10px;
  background: var(--color-green-dark);
  color: white;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: #16612f;
}

/* =============================
   TABLE + SHOW PAGE
============================= */

.actions-bar {
  margin-bottom: 20px;
}

.design-table {
  width: 100%;
  border-collapse: collapse;
}

.design-table th,
.design-table td {
  padding: 10px;
  border-bottom: 1px solid #e5e5e5;
  text-align: left;
}

.design-table .thumb {
  height: 80px;
  border: 1px solid #ddd;
}

.no-image {
  color: #999;
}

.actions .btn-small {
  padding: 6px 10px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  margin-right: 6px;
  text-decoration: none;
  font-size: 13px;
}

.actions .btn-small:hover {
  background: #e5e5e5;
}

.actions .danger {
  background: #fbeaea;
  border-color: #e0b4b4;
  color: #a94442;
}

.show-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.show-image {
  max-width: 600px;
  border: 1px solid #ddd;
}

.config-block {
  margin-bottom: 16px;
}

.btn-secondary {
  margin-left: 10px;
}
