/* =====================================================
   RESET BÁSICO
===================================================== */
html,
body {
  height: 100%;
  margin: 0;
}

/* =====================================================
   CONTENEDOR PRINCIPAL
===================================================== */
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 64px 1fr 56px;
  /* header | main | footer */
  background: #f9fafb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* =====================================================
   HEADER ADMIN NEGRO
===================================================== */

.admin-header {
  background: #0b0b0b;
  /* negro */
  color: #fff;
  /* texto blanco */
  border-bottom: 1px solid #111;
}

/* Título */
.admin-header strong,
.admin-header .admin-title {
  color: #fff;
}

/* Candado */
.admin-header .admin-lock {
  color: #fff;
  opacity: 0.9;
}

/* Usuario */
.admin-userbox {
  color: #fff;
  font-size: 14px;
}

/* Links del header */
.admin-header a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.admin-header a:hover {
  text-decoration: underline;
}

/* Botón menú móvil */
.admin-toggle {
  color: #fff;
}

/* =====================================================
   GRID CENTRAL
===================================================== */
.admin-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 0;
}

/* =====================================================
   SIDEBAR
===================================================== */
.admin-sidebar {
  background: linear-gradient(180deg, #1f2937, #111827);
  padding: 24px 16px;
  color: #fff;
}

/* =====================================================
   MENU
===================================================== */
.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Separadores */
.menu-separator {
  height: 1px;
  margin: 12px 8px;
  background: rgba(255, 255, 255, 0.15);
}

/* Item base */
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.2;
  transition: background .2s ease, color .2s ease;
}

/* Hover */
.menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Inicio destacado */
.menu-home {
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

/* Iconos */
.menu-item .icon {
  width: 24px;
  min-width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

/* Texto */
.menu-item .label {
  display: block;
}

/* =====================================================
   MAIN
===================================================== */
.admin-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}

/* =====================================================
   BREADCRUMB
===================================================== */
.admin-breadcrumb {
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
}

.admin-breadcrumb a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.admin-breadcrumb a:hover {
  text-decoration: underline;
}

/* =====================================================
   CONTENT
===================================================== */
.admin-content {
  flex: 1;
  padding: 15PX;
  overflow-y: auto;
}

/* =====================================================
   FOOTER
===================================================== */
.admin-footer {
  /*display: flex;*/
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  background: linear-gradient(90deg, #0b0f1a, #111827);
  border-top: 1px solid #181818;
  margin-top: -20px;
  line-height: initial;
}

.admin-footer a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
}

.admin-footer a:hover {
  color: #ffffff;
  text-decoration: none;
  text-decoration: underline;
}

.admin-footer small {
  color: #ffffff;
}

/* ===== ACCIONES ALIGN FIX ===== */

.actions-wrap {
  display: flex;
  align-items: center;
  /* 🔥 CLAVE: alineación vertical */
  gap: 8px;
}

/* Normaliza botones y links */
.actions-wrap button,
.actions-wrap a {
  height: 36px;
  /* misma altura */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  font-size: 14px;
  line-height: 1;
  border-radius: 8px;
}

/* Botón Guardar */
.actions-wrap .btn-save {
  background: #4f6fad;
  color: #fff;
  border: none;
}

/* Botón Ver */
.actions-wrap .btn-view {
  background: #e5e7eb;
  color: #111827;
  text-decoration: none;
}

/* =====================================================
   RESPONSIVE ADMIN
===================================================== */

/* ===== BOTÓN MENU (solo móvil) ===== */
.admin-toggle {
  display: none;
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
}

/* ===== TABLET & MOBILE ===== */
@media (max-width: 1024px) {

  /* Mostrar botón menú */
  .admin-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
  }

  /* Header ajustado */
  .admin-header {
    padding: 0 16px;
  }

  /* Grid pasa a una columna */
  .admin-grid {
    grid-template-columns: 1fr;
  }

  /* Sidebar como drawer */
  .admin-sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    height: calc(100vh - 64px);
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1000;
  }

  /* Sidebar visible */
  body.menu-open .admin-sidebar {
    transform: translateX(0);
  }

  /* Main ocupa todo */
  .admin-main {
    width: 100%;
  }

  /* Breadcrumb más compacto */
  .admin-breadcrumb {
    padding: 12px 16px;
    font-size: 13px;
  }

  /* Content padding reducido */
  .admin-content {
    padding: 16px;
  }
}

/* ===== MOBILE PEQUEÑO ===== */
@media (max-width: 640px) {

  /* Texto del menú un poco más chico */
  .menu-item {
    font-size: 13px;
  }

  /* Footer compacto */
  .admin-footer {
    font-size: 12px;
    padding: 8px;
  }
}

.admin-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.admin-lock {
  font-size: 16px;
  opacity: 0.85;
}

/* =====================================================
   HEADER SUPERIOR ELEGANTE
===================================================== */

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 🔥 CLAVE */
  padding: 0 24px;
  height: 64px;
  background: #000;
  color: #fff;
  border-bottom: 1px solid #111;
}

/* Bloque izquierdo */
.admin-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Bloque derecho */
.admin-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

/* Título */
.admin-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
}

/* Candado */
.admin-lock {
  font-size: 14px;
  opacity: 0.85;
}

/* Usuario */
.admin-user {
  opacity: 0.9;
}

/* Logout */
.admin-logout {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.admin-logout:hover {
  text-decoration: underline;
}

/* Botón menú */
.admin-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

/* ===============================
   ADMIN QUEEN PREVIEW FIX
================================ */

/* contenedor del preview */
.admin-preview-wrap {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}

/* scope del frontend dentro del admin */
.queen-preview-scope {
  width: 100%;
  max-width: 420px;
  /* 👈 CLAVE */
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .15);
}

/* imágenes NO fullscreen */
.queen-preview-scope img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* reset de reglas agresivas del frontend */
.queen-preview-scope * {
  box-sizing: border-box;
}

/* ===============================
   QUEEN PREVIEW — ADMIN SAFE
================================ */

.admin-preview-wrap {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

/* SIMULA CONTENEDOR REAL */
.queen-preview-scope {
  width: 100%;
  max-width: 420px;
  /* 👈 CLAVE */
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
}

/* CONTENCIÓN DE IMÁGENES */
.queen-preview-scope img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* EVITA HERENCIAS LOCAS */
.queen-preview-scope * {
  box-sizing: border-box;
}

.queen-preview-scope {
  max-width: 420px;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, .25),
    0 0 0 8px #111;
  /* marco */
}