:root {
  --bg: #0c0c0c;
  --surface: #151515;
  --surface-2: #1b1b1b;
  --text: #f5efe7;
  --muted: #b8aea1;
  --line: rgba(255,255,255,0.09);
  --accent: #d8c7b2;
  --danger: #da7474;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(216, 199, 178, 0.10), transparent 30%),
    linear-gradient(180deg, #090909 0%, #111111 100%);
  min-height: 100vh;
}

img { display: block; max-width: 100%; }

.top-bar {
  border-bottom: 1px solid var(--line);
  background: rgba(18, 18, 18, 0.80);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar-content {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile-tag {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name {
  font-weight: 500;
  color: var(--accent);
}

.admin-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(18, 18, 18, 0.84);
  backdrop-filter: blur(16px);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.admin-hero h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.admin-hero p { margin: 0; color: var(--muted); }

.back-link {
  color: var(--accent);
  text-decoration: none;
  transition: opacity .2s;
}
.back-link:hover { opacity: 0.8; }

.status-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(216, 199, 178, 0.22);
  color: var(--accent);
  background: rgba(216, 199, 178, 0.08);
  font-size: 0.85rem;
}

.admin-accordion {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(18, 18, 18, 0.84);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color .2s ease;
}

.admin-accordion[open] {
  border-color: rgba(216, 199, 178, 0.3);
}

.accordion-header {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  user-select: none;
}

.accordion-header::-webkit-details-marker { display: none; }

.chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

.admin-accordion[open] .chevron {
  transform: rotate(-135deg);
}

.accordion-content {
  padding: 0 24px 24px;
  border-top: 1px solid var(--line);
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.25s ease;
}

.modal-backdrop[hidden] { display: none; }

.modal-card {
  width: min(420px, calc(100% - 32px));
  background: #151515;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow);
  transform: scale(1);
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.admin-form, .entity-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.admin-form input,
.entity-form input,
.entity-form textarea,
.entity-form select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 12px 16px;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
}

.entity-form select option {
  background: #151515;
  color: var(--text);
}

.admin-form input:focus,
.entity-form input:focus,
.entity-form textarea:focus,
.entity-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(216, 199, 178, 0.15);
}

.checkbox-group {
  display: flex;
  gap: 20px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.button {
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  transition: transform .18s ease, opacity .18s ease, background-color .18s ease;
}

.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.button-primary { background: linear-gradient(135deg, var(--accent), #f4eadf); color: #181716; }
.button-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.button-danger { background: rgba(218, 116, 116, 0.14); color: #ffd9d9; border: 1px solid rgba(218, 116, 116, 0.24); }
.button-full { width: 100%; }
.button-sm { padding: 6px 12px; font-size: 0.85rem; }

.file-upload-wrapper {
  display: grid;
  gap: 10px;
}

.file-label {
  display: block;
  padding: 12px;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  color: var(--accent);
  transition: background 0.2s;
}

.file-label:hover { background: rgba(216, 199, 178, 0.05); }

.file-upload-wrapper input[type="file"] { display: none; }

.image-preview img {
  max-height: 120px;
  border-radius: 12px;
  object-fit: cover;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.admin-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  border-radius: 16px;
  overflow: hidden;
}

.admin-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.admin-card-copy { padding: 14px; }
.admin-card-top { display: flex; justify-content: space-between; align-items: start; }
.admin-card-top h3 { margin: 0; font-size: 1rem; }

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  border-radius: 14px;
  margin-top: 10px;
}

.list-row p { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #181716;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: rgba(17,17,17,0.92);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 12px 24px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  z-index: 200;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  color: var(--accent);
}

.two-cols { display: flex; gap: 12px; }
.two-cols > * { flex: 1; }

@media (max-width: 720px) {
  .admin-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .two-cols { flex-direction: column; }
  .top-bar-content { padding: 0 16px; }
}
/* ===== Mejoras visuales 2026 ===== */
.entity-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--surface-2);
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-bottom: 24px;
}

.entity-form input,
.entity-form textarea,
.entity-form select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0f0f0f;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.entity-form input:focus,
.entity-form textarea:focus,
.entity-form select:focus {
  outline: none;
  border-color: rgba(216, 199, 178, 0.55);
  box-shadow: 0 0 0 3px rgba(216, 199, 178, 0.12);
}

.entity-form textarea {
  resize: vertical;
  min-height: 80px;
}

.file-upload-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.image-preview {
  margin-top: 8px;
  border-radius: 12px;
  overflow: hidden;
  max-width: 180px;
  border: 1px solid var(--line);
}

.image-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.checkbox-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.button-primary {
  background: linear-gradient(135deg, #d8c7b2, #c4b09a);
  color: #1a1510;
  border-color: transparent;
}

.button-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.button-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
}

.button-ghost:hover {
  background: rgba(216, 199, 178, 0.08);
}

.button-danger {
  background: rgba(218, 116, 116, 0.15);
  color: #f0a0a0;
  border-color: rgba(218, 116, 116, 0.3);
}

.button-danger:hover {
  background: rgba(218, 116, 116, 0.28);
}

.button-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.entity-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.entity-card:hover {
  border-color: rgba(216, 199, 178, 0.35);
  transform: translateY(-2px);
}

.entity-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #1a1a1a;
}

.entity-card-body {
  padding: 14px 16px 16px;
}

.entity-card-body h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.entity-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 10px 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.entity-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
}

.accordion-header::-webkit-details-marker { display: none; }

.accordion-header h2 {
  margin: 4px 0 0;
  font-size: 1.25rem;
}

.chevron::after {
  content: "▾";
  color: var(--muted);
  transition: transform 0.2s;
}

details[open] .chevron::after {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 0 22px 22px;
  border-top: 1px solid var(--line);
}

.admin-warning {
  background: rgba(218, 116, 116, 0.12);
  border: 1px solid rgba(218, 116, 116, 0.35);
  color: #f0b0b0;
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 20px;
}

.muted { color: var(--muted); }

@media (max-width: 640px) {
  .grid-cards {
    grid-template-columns: 1fr;
  }
  .form-actions {
    flex-direction: column;
  }
  .button {
    width: 100%;
  }
}

/* ========== Checkboxes bonitos ========== */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin: 4px 0;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--muted);
  user-select: none;
  transition: color 0.15s ease;
}

.checkbox-group label:hover {
  color: var(--text);
}

/* Ocultamos el checkbox nativo */
.checkbox-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

/* Estado checked */
.checkbox-group input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #d8c7b2, #c4b09a);
  border-color: #d8c7b2;
}

/* La marca de verificación */
.checkbox-group input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #1a1510;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Focus accesible */
.checkbox-group input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(216, 199, 178, 0.25);
}