.admin-page { padding: 42px 0 72px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.admin-card {
  background: white;
  border: 1px solid #e7e7e7;
  border-radius: 22px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
}
.admin-card h1, .admin-card h2 { margin-top: 0; }
label { display: grid; gap: 8px; margin-bottom: 14px; font-weight: 800; }
input, textarea {
  width: 100%;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  background: white;
}
textarea { min-height: 80px; resize: vertical; }
.small-btn {
  border: 0;
  border-radius: 999px;
  background: var(--dark);
  color: white;
  padding: 10px 18px;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: opacity .15s;
}
.small-btn:hover { opacity: .85; }
.small-btn.danger { background: #b00020; }
.editor-list { display: grid; gap: 14px; }
.edit-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 10px;
  align-items: center;
}

/* ── produto card ── */
.edit-product {
  display: grid;
  grid-template-columns: 1fr 160px 160px;
  gap: 10px;
  padding: 16px;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  background: #fafafa;
}
.edit-product textarea,
.edit-product .img-field-wrap,
.edit-product .product-actions { grid-column: 1 / -1; }

/* ── image field ── */
.img-field-wrap { display: flex; flex-direction: column; gap: 8px; }
.img-field-label { font-weight: 800; font-size: 14px; color: #333; }

.img-preview-box {
  position: relative;
  width: 100%;
  height: 180px;
  border: 2px dashed #ccc;
  border-radius: 14px;
  overflow: hidden;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.img-preview-box:hover { border-color: var(--primary); background: #fdf0f0; }
.img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #aaa;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  text-align: center;
  padding: 12px;
}
.img-placeholder svg { opacity: .5; }

/* file input invisível sobre a box inteira */
.img-preview-box input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 0;
}

.img-actions { display: flex; gap: 8px; align-items: center; }
.img-url-input { flex: 1; font-size: 12px; }
.img-remove-btn {
  border: 0;
  border-radius: 999px;
  background: #b00020;
  color: white;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.product-actions { display: flex; gap: 8px; padding-top: 4px; }

#jsonOutput { min-height: 220px; font-family: Consolas, monospace; font-size: 13px; }

@media (max-width: 800px) {
  .admin-grid,
  .edit-row,
  .edit-product { grid-template-columns: 1fr; }
}
