/* =========================================================================
   Panel de administración — estilos
   ========================================================================= */
.admin { background: var(--bg-soft); min-height: 100vh; }

.admin-header { background: var(--black); color: #fff; position: sticky; top: 0; z-index: 30; }
.admin-header__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.admin-header .brand__text strong { color: #fff; }
.admin-header .btn--ghost { color: #fff; border-color: rgba(255,255,255,.2); }
.admin-header .btn--ghost:hover { border-color: var(--red-light); color: var(--red-light); }
.admin-header__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.admin-main { padding: 30px 22px 60px; }

/* Stats */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.admin-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; text-align: center; box-shadow: var(--shadow-sm); }
.admin-stat strong { display: block; font-family: "Poppins", sans-serif; font-size: 1.9rem; font-weight: 800; color: var(--red); }
.admin-stat span { font-size: .85rem; color: var(--muted); }

/* Grid */
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 940px) { .admin-grid { grid-template-columns: 420px 1fr; align-items: start; } }

.admin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.admin-card h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }

/* Form */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: .86rem; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; font-family: inherit; font-size: .95rem;
  background: var(--bg-soft); transition: border-color .2s var(--ease), background .2s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); background: #fff; }
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: .76rem; color: var(--muted); }

.img-preview { position: relative; border: 1px dashed var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.img-preview img { max-height: 160px; margin: 0 auto 10px; border-radius: 8px; }
.img-preview__remove { background: #ffe9e8; color: var(--red); border: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; cursor: pointer; font-size: .82rem; }

.form__actions { display: flex; gap: 10px; margin-top: 6px; }

/* Listado */
.admin-list__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-list__head h2 { margin-bottom: 0; }
.admin-search { padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; font-family: inherit; font-size: .9rem; background: var(--bg-soft); min-width: 160px; }
.admin-search:focus { outline: none; border-color: var(--red); background: #fff; }

.admin-list { display: flex; flex-direction: column; gap: 12px; max-height: 640px; overflow-y: auto; }
.admin-item { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.admin-item:hover { border-color: rgba(214,0,0,.3); box-shadow: var(--shadow-sm); }
.admin-item__media { width: 56px; height: 56px; border-radius: 11px; display: grid; place-items: center; font-size: 1.8rem; background: linear-gradient(135deg, #fff6f6, #ffeaea); flex-shrink: 0; overflow: hidden; }
.admin-item__media img { width: 100%; height: 100%; object-fit: cover; }
.admin-item__info { flex: 1; min-width: 0; }
.admin-item__name { font-weight: 600; font-size: .95rem; }
.admin-item__meta { font-size: .8rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.admin-item__price { font-family: "Poppins", sans-serif; font-weight: 700; color: var(--red); }
.badge { font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #fff; }
.admin-item__actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-action { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1rem; transition: all .2s var(--ease); }
.icon-action:hover { border-color: var(--red); }
.icon-action--del:hover { background: #ffe9e8; }

.admin-empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--black); color: #fff; padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: .9rem;
  box-shadow: var(--shadow); z-index: 100; opacity: 0; transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--ok { background: #1b8f4d; }
.toast--err { background: var(--red); }

@media (max-width: 540px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
}
