/* Panel de administración */
.admin {
  width: min(1080px, 100vw - 24px); max-height: calc(100svh - 24px);
  margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 24px;
  background: var(--ink-0); color: var(--white);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.8);
}
.admin::backdrop { background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(10px); }
.admin[open] { animation: admin-in 0.5s var(--ease) both; }
@keyframes admin-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.admin-shell { position: relative; display: flex; flex-direction: column; max-height: calc(100svh - 26px); }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.admin-top h2 { font-size: 1rem; letter-spacing: 0.04em; }
.admin-top-actions { display: flex; align-items: center; gap: 10px; }
.admin-x { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--white); cursor: pointer; }
.admin-x:hover { border-color: var(--white); }
.admin-x svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.admin-body { overflow: auto; padding: 24px; }
.admin-pad { padding: 30px 0; }
.admin [hidden] { display: none !important; }
.admin-muted { color: var(--mute); }
.admin code { font-size: 0.9em; background: var(--ink-1); padding: 2px 6px; border-radius: 6px; }

.admin-card { padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--ink-1); display: grid; gap: 12px; }
.admin-narrow { max-width: 420px; margin: 20px auto; }
.admin-card h3 { font-size: 1.1rem; }
.admin-empty { text-align: center; justify-items: center; padding: 50px 24px; }

.admin label { display: grid; gap: 8px; font-size: 0.88rem; font-weight: 600; color: var(--mute); }
.admin input, .admin select, .admin textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: 500 1rem/1.4 var(--text); color: var(--white);
  background: var(--black); border: 1px solid var(--line-strong); border-radius: 12px;
  transition: border-color 0.2s;
}
.admin textarea { resize: vertical; min-height: 96px; }
.admin input:focus, .admin select:focus, .admin textarea:focus { outline: none; border-color: var(--white); }
.admin input::placeholder, .admin textarea::placeholder { color: #6f6f6c; }
.admin-error { color: #ff8a80; font-size: 0.92rem; min-height: 1.2em; }
.admin-error:empty { display: none; }
.admin .btn:disabled { opacity: 0.6; cursor: progress; transform: none; }

.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.admin-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-stats div { padding: 10px 16px; border: 1px solid var(--line); border-radius: 14px; min-width: 92px; }
.admin-stats dt { font-size: 0.75rem; color: var(--mute); letter-spacing: 0.06em; text-transform: uppercase; }
.admin-stats dd { margin: 2px 0 0; font: 400 1.25rem/1.1 var(--display); }

.admin-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.admin-row {
  display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 16px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--ink-1);
}
.admin-thumb { width: 56px; height: 56px; border-radius: 12px; background: var(--black); display: grid; place-items: center; overflow: hidden; }
.admin-thumb img { width: 100%; height: 100%; object-fit: contain; }
.admin-thumb svg { height: 80%; width: auto; opacity: 0.6; }
.admin-row-main { display: grid; gap: 4px; min-width: 0; }
.admin-row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row-main .tag { font-size: 0.66rem; padding: 4px 10px; }
.admin-stepper { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.admin-stepper button { width: 40px; height: 40px; border: 0; background: none; color: var(--white); font-size: 1.2rem; cursor: pointer; }
.admin-stepper button:hover { background: rgba(255, 255, 255, 0.08); }
.admin-stepper input { width: 56px; min-height: 40px; padding: 0; border: 0; border-radius: 0; text-align: center; font-variant-numeric: tabular-nums; background: transparent; -moz-appearance: textfield; }
.admin-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.admin-row-actions { display: flex; align-items: center; gap: 8px; }
.admin-icon-link { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); }
.admin-icon-link:hover { border-color: var(--white); }
button.admin-icon-link { background: none; color: var(--white); cursor: pointer; }
.admin-icon-danger { color: #ff8a80 !important; border-color: rgba(255, 138, 128, 0.45) !important; }
.admin-icon-danger:hover { background: rgba(255, 138, 128, 0.1) !important; border-color: #ff8a80 !important; }
.admin-icon-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.admin-editor-head { display: grid; gap: 8px; margin-bottom: 22px; }
.admin-back, .admin-link-btn { background: none; border: 0; padding: 0; color: var(--mute); font: 600 0.9rem var(--text); cursor: pointer; justify-self: start; }
.admin-back:hover, .admin-link-btn:hover { color: var(--white); }
.admin-editor-head h3 { font-size: 1.3rem; }
.admin-editor-grid { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.admin-photo { display: grid; gap: 12px; justify-items: start; }
.admin-photo-box { width: 100%; aspect-ratio: 4 / 5; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: 18px; background: var(--black); overflow: hidden; }
.admin-photo-box img { width: 100%; height: 100%; object-fit: contain; }
.admin-file { cursor: pointer; }
.admin-hint { font-size: 0.82rem; font-weight: 500; }
.admin-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-fields .span-2 { grid-column: 1 / -1; }
.admin-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.admin-spacer { flex: 1; }
.admin-danger { background: none; border: 1px solid rgba(255, 138, 128, 0.5); color: #ff8a80; border-radius: 999px; min-height: 44px; padding: 0 18px; font: 600 0.9rem var(--text); cursor: pointer; }
.admin-danger:hover { background: rgba(255, 138, 128, 0.1); }

.admin-toast {
  position: absolute; left: 50%; bottom: 18px; translate: -50% 20px; opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 12px; background: var(--white); color: var(--black); font-weight: 600; font-size: 0.92rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); transition: opacity 0.3s, translate 0.4s var(--ease);
}
.admin-toast.show { opacity: 1; translate: -50% 0; }
.admin-toast[data-tipo="error"] { background: #ff8a80; }

@media (max-width: 760px) {
  .admin { width: 100vw; max-width: 100vw; max-height: 100svh; height: 100svh; border-radius: 0; }
  .admin-shell { max-height: 100svh; height: 100%; }
  .admin-body { padding: 16px; }
  .admin-top { padding: 14px 16px; }
  .admin-row { grid-template-columns: 48px 1fr; gap: 10px 12px; }
  .admin-thumb { width: 48px; height: 48px; }
  .admin-stepper { grid-column: 1 / -1; justify-self: start; }
  .admin-row-actions { grid-column: 1 / -1; }
  .admin-editor-grid, .admin-fields { grid-template-columns: 1fr; }
  .admin-photo-box { max-width: 220px; }
  .admin-toolbar .btn { width: 100%; }
}
