.admin-body { background: #f7f3f4; min-height: 100vh; }
.admin-header {
  min-height: 72px;
  padding: 0 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.admin-header > div:first-child { display: grid; gap: 2px; }
.admin-subtitle { color: var(--muted); font-size: .78rem; }
.admin-header-actions { display: flex; align-items: center; gap: 10px; }

.admin-shell { max-width: 1450px; margin: auto; padding: 34px 4vw 70px; display: grid; gap: 24px; }
.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.admin-stats article {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 10px 28px rgba(77,44,55,.06);
}
.admin-stats strong { display: block; font-family: Georgia,serif; font-size: 1.9rem; }
.admin-stats span { color: var(--muted); font-size: .82rem; }

.admin-card, .login-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.login-card { width: min(460px, 92vw); margin: 10vh auto; }
.login-card h1 { font-size: 2.4rem; }
.admin-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; }
.admin-title h1 { font-size: clamp(2rem,4vw,3rem); margin: 7px 0 8px; }
.admin-help { color: var(--muted); max-width: 800px; margin: 0; line-height: 1.6; }

.admin-toolbar { margin: 24px 0 18px; }
.admin-toolbar input {
  width: min(520px,100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
}

.models-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(260px,1fr));
  gap: 16px;
}
.model-admin-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  cursor: grab;
}
.model-admin-card.dragging { opacity: .45; }
.model-admin-cover {
  aspect-ratio: 16/11;
  background: var(--soft);
  position: relative;
  overflow: hidden;
}
.model-admin-cover img { width: 100%; height: 100%; object-fit: cover; }
.model-admin-cover .no-image { height: 100%; display: grid; place-items: center; color: var(--muted); }
.visibility-pill {
  position: absolute;
  left: 10px;
  top: 10px;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: .72rem;
  font-weight: 800;
  background: rgba(255,255,255,.92);
}
.model-admin-body { padding: 15px; }
.model-admin-body h3 { margin: 0 0 5px; font-size: 1.25rem; }
.model-admin-meta { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.admin-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 13px; }

.ghost-button, .icon-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 9px 13px;
  cursor: pointer;
  color: var(--text);
}
.icon-button { font-size: 1.5rem; line-height: 1; width: 40px; height: 40px; padding: 0; }
.danger { color: #a02e43; }
.small-button { margin-top: 0; padding: 10px 15px; }
.save-button { justify-self: start; min-width: 180px; }

.secondary-card summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  list-style: none;
}
.secondary-card summary::-webkit-details-marker { display: none; }
.secondary-card summary > div { display: grid; gap: 4px; }
.category-form { margin-top: 25px; grid-template-columns: 1fr 1fr 1fr auto; align-items: end; }
.admin-list { display: grid; gap: 10px; margin-top: 18px; }
.admin-row {
  display: grid;
  grid-template-columns: 60px minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
}
.admin-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; background: var(--soft); }

/* dialogs */
dialog {
  border: 0;
  border-radius: 24px;
  padding: 0;
  width: min(760px, 95vw);
  max-height: 92vh;
  box-shadow: 0 30px 90px rgba(0,0,0,.26);
}
dialog.wide-dialog { width: min(1080px, 96vw); }
dialog::backdrop { background: rgba(44,30,35,.52); backdrop-filter: blur(2px); }
.dialog-shell { padding: 26px; max-height: 92vh; overflow: auto; }
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}
.dialog-head h2 { margin: 5px 0 0; font-size: 2rem; }

.admin-form { display: grid; gap: 15px; }
.admin-form label { display: grid; gap: 7px; font-weight: 700; font-size: .88rem; }
.admin-form input:not([type="checkbox"]):not([type="color"]),
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
}
.admin-form input[type="color"] { width: 100%; height: 45px; border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: white; }
.form-grid.two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.check-row { display: flex; gap: 20px; flex-wrap: wrap; }
.check-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; }
.check-label input { width: 18px; height: 18px; }

.upload-box {
  border: 1px dashed #cfb8c0;
  border-radius: 15px;
  padding: 16px;
  background: #fffafb;
}
.upload-box span { color: var(--muted); font-weight: 400; font-size: .8rem; }
.upload-box input { margin-top: 8px; }

.compact-status { padding: 5px; text-align: left; min-height: 20px; }
.editor-section { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 25px; }
.section-mini-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.section-mini-head h3 { margin: 5px 0 0; font-size: 1.55rem; }
.muted-note { color: var(--muted); font-size: .78rem; line-height: 1.5; }

.photo-manager {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(145px,1fr));
  gap: 12px;
  margin-top: 16px;
}
.photo-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: white;
  cursor: grab;
}
.photo-item.dragging { opacity: .45; }
.photo-item img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--soft); }
.photo-item-actions { padding: 8px; display: grid; gap: 6px; }
.photo-item-actions button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  padding: 7px 8px;
  cursor: pointer;
  font-size: .72rem;
}
.photo-item.portada { box-shadow: 0 0 0 2px var(--accent); }
.portada-label {
  display: block;
  text-align: center;
  background: var(--accent);
  color: white;
  padding: 5px;
  font-size: .68rem;
  font-weight: 800;
}

.colors-admin-list { display: grid; gap: 10px; margin-top: 16px; }
.color-admin-row {
  display: grid;
  grid-template-columns: 64px minmax(0,1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 9px 12px;
  cursor: grab;
}
.color-admin-row.dragging { opacity: .45; }
.color-admin-preview {
  width: 64px; height: 64px; border-radius: 12px; overflow: hidden;
  background: var(--soft); display: grid; place-items: center;
}
.color-admin-preview img { width: 100%; height: 100%; object-fit: cover; }
.color-admin-dot { width: 35px; height: 35px; border-radius: 50%; background: var(--color,#eee); box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.color-admin-row strong { display: block; }
.color-admin-row small { color: var(--muted); display: block; margin-top: 3px; }

@media (max-width: 800px) {
  .admin-header { padding: 10px 4vw; }
  .admin-subtitle { display: none; }
  .admin-shell { padding: 20px 4vw 50px; }
  .admin-stats { grid-template-columns: repeat(3,1fr); }
  .admin-stats article { padding: 12px; }
  .admin-stats strong { font-size: 1.4rem; }
  .admin-card { padding: 18px; }
  .admin-title { flex-direction: column; }
  .models-admin-grid { grid-template-columns: 1fr; }
  .form-grid.two, .category-form { grid-template-columns: 1fr; }
  .section-mini-head { flex-direction: column; }
  .photo-manager { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .color-admin-row { grid-template-columns: 54px minmax(0,1fr); }
  .color-admin-preview { width: 54px; height: 54px; }
  .color-admin-row .admin-actions { grid-column: 1 / -1; }
}

.order-controls { display:flex; gap:8px; padding:8px; flex-wrap:wrap; }
.order-controls button { min-height:36px; padding:6px 10px; border:1px solid #ddd; border-radius:8px; background:white; cursor:pointer; }
button:disabled { opacity:.5; cursor:default; }
.color-admin-row { flex-wrap:wrap; }
