/* DAVDS3D — admin.css (panel administrador) */

.admin-body {
  min-height: 100vh;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 20%, rgba(76,245,224,0.10), transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(255,95,184,0.08), transparent 50%),
    var(--bg, #0b0d12);
}

/* ---------- Login ---------- */
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(18,21,30,0.7);
  border: 1px solid var(--panel-border, rgba(255,255,255,0.08));
  border-radius: 20px;
  padding: 36px 32px;
  text-align: center;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin: 0 auto 16px;
  border-radius: 14px;
}

.login-card h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
  margin: 0 0 8px;
}

.login-card p {
  color: var(--muted, #9aa3b2);
  font-size: 0.92rem;
  margin: 0 0 24px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted, #9aa3b2);
}

.login-card input,
.modal-form input,
.modal-form textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--panel-border, rgba(255,255,255,0.1));
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text, #f3f5f9);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-card input:focus,
.modal-form input:focus,
.modal-form textarea:focus {
  border-color: var(--cyan, #4cf5e0);
  box-shadow: 0 0 0 3px rgba(76,245,224,0.15);
}

.login-error {
  color: #ff6b6b;
  font-size: 0.85rem;
  margin: 0;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--muted, #9aa3b2);
  font-size: 0.85rem;
  text-decoration: none;
}
.back-link:hover { color: var(--cyan, #4cf5e0); }

/* ---------- Panel ---------- */
.admin-panel { padding-bottom: 80px; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--panel-border, rgba(255,255,255,0.08));
  background: rgba(11,13,18,0.7);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.admin-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.admin-header .brand img { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; }
.admin-header .brand small {
  display: block;
  font-family: "Sora", sans-serif;
  font-weight: 400;
  letter-spacing: normal;
  color: var(--muted, #9aa3b2);
  font-size: 0.7rem;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user {
  font-size: 0.82rem;
  color: var(--muted, #9aa3b2);
}

.admin-content { padding-top: 32px; }

.admin-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.admin-toolbar h2 { margin: 0 0 6px; font-family: "Space Grotesk", sans-serif; }
.admin-toolbar .dim { color: var(--muted, #9aa3b2); margin: 0; font-size: 0.88rem; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-border, rgba(255,255,255,0.08));
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.6rem;
  color: var(--cyan, #4cf5e0);
}
.stat-card span { color: var(--muted, #9aa3b2); font-size: 0.8rem; }

/* ---------- Lista admin (drag & drop) ---------- */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-row {
  display: grid;
  grid-template-columns: auto 64px 1fr auto auto;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-border, rgba(255,255,255,0.08));
  border-radius: 14px;
  padding: 12px 16px;
  cursor: grab;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.admin-row:hover { border-color: rgba(76,245,224,0.3); }
.admin-row.dragging {
  opacity: 0.5;
  cursor: grabbing;
}
.admin-row.drag-over {
  border-color: var(--cyan, #4cf5e0);
  box-shadow: 0 0 0 1px var(--cyan, #4cf5e0);
}

.row-handle {
  color: var(--muted, #9aa3b2);
  display: flex;
  align-items: center;
  font-size: 1.1rem;
  user-select: none;
}

.row-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--panel-border, rgba(255,255,255,0.08));
}

.row-info { min-width: 0; }
.row-name {
  font-weight: 600;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.row-cat {
  font-size: 0.78rem;
  color: var(--muted, #9aa3b2);
  text-transform: capitalize;
}
.row-badge {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255,180,84,0.15);
  color: var(--amber, #ffb454);
  border: 1px solid rgba(255,180,84,0.3);
}
.row-price {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: var(--cyan, #4cf5e0);
  white-space: nowrap;
}
.row-actions {
  display: flex;
  gap: 8px;
}
.row-actions button {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--panel-border, rgba(255,255,255,0.1));
  color: var(--text, #f3f5f9);
  border-radius: 9px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.row-actions button:hover { border-color: var(--cyan, #4cf5e0); color: var(--cyan, #4cf5e0); }

.admin-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted, #9aa3b2);
  border: 1px dashed var(--panel-border, rgba(255,255,255,0.12));
  border-radius: 16px;
}

/* ---------- Modal ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,6,10,0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 40;
}
.overlay.open { opacity: 1; visibility: visible; }

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-modal[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  background: rgba(18,21,30,0.92);
  border: 1px solid var(--panel-border, rgba(255,255,255,0.1));
  border-radius: 18px;
  padding: 26px;
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-head h3 { margin: 0; font-family: "Space Grotesk", sans-serif; }

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted, #9aa3b2);
}
.modal-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.modal-form .small { font-size: 0.74rem; }
.modal-form textarea { resize: vertical; font-family: inherit; }

.switch-row {
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 12px 16px;
}
.switch-row .switch-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.switch-row .switch-label strong {
  color: var(--text, #f3f5f9);
  font-size: 0.9rem;
  font-weight: 600;
}
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--panel-border, rgba(255,255,255,0.12));
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.switch-track::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}
.switch input:checked + .switch-track {
  background: linear-gradient(120deg, var(--cyan, #4cf5e0), var(--magenta, #ff5fb8));
  border-color: transparent;
}
.switch input:checked + .switch-track::before { transform: translateX(20px); }

.img-preview {
  display: flex;
  justify-content: center;
}
.img-preview img {
  max-width: 160px;
  max-height: 160px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--panel-border, rgba(255,255,255,0.1));
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.modal-actions .btn-ghost {
  color: #ff6b6b;
  border-color: rgba(255,107,107,0.3);
}
.modal-actions .btn-ghost:hover { border-color: #ff6b6b; }

@media (max-width: 640px) {
  .admin-row {
    grid-template-columns: auto 52px 1fr;
    grid-template-rows: auto auto;
  }
  .row-price { grid-column: 2 / 3; grid-row: 2; }
  .row-actions { grid-column: 3 / 4; grid-row: 2; justify-content: flex-end; }
  .modal-form .form-row { grid-template-columns: 1fr; }
}
