/* =====================================================================
   PANEL DE ADMINISTRACIÓN — BODA ELENA & LUCAS (DEMO)
   Estilo Elegante, Profesional, No-Plano (Dark Velvet & Champagne Gold)
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Alex+Brush&family=Montserrat:wght@400;500;600&family=Tangerine:wght@400&family=Comfortaa:wght@500;600&family=Pinyon+Script&family=WindSong:wght@400;500&display=swap');

:root {
  --bg-primary: #FAF8F5;
  --bg-surface: #F1ECE4;
  --text-primary: #1F1D1B;
  --text-secondary: #6E665E;
  --accent-gold: #B8935A;
  --accent-gold-hover: #9A7742;
  --border-subtle: #E2D9CC;

  --admin-bg: #1B0E14;
  --admin-surface: #26141D;
  --admin-surface-light: #341D28;
  --admin-card-border: rgba(184, 147, 90, 0.25);
  
  --gold-primary: #B8935A;
  --gold-light: #E2D9CC;
  --gold-gradient: linear-gradient(135deg, #CFAF7A 0%, #B8935A 50%, #9A7742 100%);
  --gold-glow: 0 0 25px rgba(184, 147, 90, 0.35);

  --text-white: #FFFFFF;
  --text-dim: #D4BAC4;
  --text-muted: #8E737E;
  
  --shadow-dark: 0 16px 36px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(184, 147, 90, 0.2);

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-script: 'Alex Brush', cursive;
  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--admin-bg);
  color: var(--text-white);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 80% 10%, rgba(184, 147, 90, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(74, 21, 37, 0.25) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Header de Administración */
.admin-header {
  background: rgba(38, 20, 29, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--admin-card-border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: grid;
  place-items: center;
  color: #1F1D1B;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: var(--gold-glow);
}

.admin-brand-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--gold-light);
  line-height: 1.1;
}

.admin-brand-sub {
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.admin-user-menu {
  display: flex;
  align-items: center;
  gap: 18px;
}

.user-name-tag {
  font-size: 0.88rem;
  color: var(--gold-light);
  font-weight: 600;
}

/* Layout del Dashboard */
.admin-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

/* Tarjetas de Métricas Estadísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-card-border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(184, 147, 90, 0.45);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gold-gradient);
}

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1;
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 6px;
}

/* Barra de Acciones y Herramientas */
.admin-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-card-border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-card);
}

.actions-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Botones del Admin */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.25s ease;
}

.admin-btn-gold {
  background: var(--gold-gradient);
  color: #1F1D1B;
  box-shadow: 0 4px 14px rgba(184, 147, 90, 0.35);
}

.admin-btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(184, 147, 90, 0.5);
}

.admin-btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-card-border);
  color: var(--gold-light);
}

.admin-btn-outline:hover {
  background: rgba(184, 147, 90, 0.15);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
}

.admin-btn-danger {
  background: #C62828;
  color: #FFFFFF;
}

.admin-btn-danger:hover {
  background: #D32F2F;
}

/* Pestañas del Panel */
.admin-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(184, 147, 90, 0.2);
  padding-bottom: 12px;
}

.admin-tab {
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.94rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-tab:hover {
  color: var(--gold-light);
  background: rgba(255, 255, 255, 0.04);
}

.admin-tab.active {
  color: #1F1D1B;
  background: var(--gold-gradient);
  box-shadow: 0 4px 15px rgba(184, 147, 90, 0.3);
}

/* Grilla Multimedia de Gestión */
.media-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  justify-content: center;
}

.admin-media-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: all 0.25s ease;
}

.admin-media-card:hover {
  border-color: var(--gold-primary);
  transform: translateY(-4px);
}

.admin-media-card.selected {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px var(--gold-primary), var(--shadow-dark);
}

.admin-card-select-wrap {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
}

.admin-checkbox {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: var(--gold-primary);
}

.admin-media-preview {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  cursor: pointer;
  background: #15090F;
}

.admin-media-meta {
  padding: 14px;
}

.admin-media-author {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--gold-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-media-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
}

.admin-media-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Libro de Firmas en el Admin */
.guestbook-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
}

.guestbook-table tr {
  background: var(--admin-surface);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease;
}

.guestbook-table tr:hover {
  transform: translateY(-2px);
}

.guestbook-table td, .guestbook-table th {
  padding: 18px 20px;
  text-align: left;
}

.guestbook-table th {
  color: var(--gold-light);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-bottom: 8px;
  background: transparent;
}

.guestbook-table td:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-left: 3px solid var(--gold-primary);
}

.guestbook-table td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.guestbook-msg-preview {
  max-width: 480px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-dim);
  cursor: pointer;
}

.guestbook-msg-preview:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

/* =====================================================================
   TARJETA IMPRIMIBLE DE MESA PARA EL CÓDIGO QR (Papelería Editorial Minimalista)
   ===================================================================== */
.qr-printable-card {
  width: min(100%, 460px);
  margin: 0 auto;
  background: #FAF8F5;
  color: #1F1D1B;
  border-radius: 4px;
  padding: 40px 40px 30px;
  box-shadow: var(--shadow-dark);
  text-align: center;
  position: relative;
  border: 1px solid rgba(31, 29, 27, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-printable-card::before {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(184, 147, 90, 0.34);
  pointer-events: none;
}

.qr-card-couple {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
  margin-bottom: 22px;
}

.qr-card-names {
  width: 100%;
  text-align: center;
  font-family: 'WindSong', var(--font-script);
  font-style: normal;
  font-weight: 500;
  font-size: 2.4rem;
  color: #1F1D1B;
  line-height: 1.18;
  margin-bottom: 6px;
}

.qr-card-date {
  font-family: 'Cinzel', var(--font-serif);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: #8A6B3D;
  padding-left: 0.36em;
  margin-bottom: 0;
}

.qr-frame {
  position: relative;
  width: 216px;
  height: 216px;
  margin: 0 auto 18px;
  padding: 13px;
  background: #FAF8F5;
  border: 0;
  box-shadow: none;
}

.qr-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(184, 147, 90, 0.72);
  border-style: solid;
  pointer-events: none;
}

.qr-corner-tl { top: 0; left: 0; border-width: 1.2px 0 0 1.2px; }
.qr-corner-tr { top: 0; right: 0; border-width: 1.2px 1.2px 0 0; }
.qr-corner-bl { bottom: 0; left: 0; border-width: 0 0 1.2px 1.2px; }
.qr-corner-br { bottom: 0; right: 0; border-width: 0 1.2px 1.2px 0; }

.qr-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-card-heart {
  display: block;
  color: #B8935A;
  margin: 0 auto 12px;
}

.qr-card-copy {
  margin-bottom: 0;
}

.qr-card-instructions {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.48rem;
  font-weight: 700;
  color: #1F1D1B;
  line-height: 1.24;
  margin-bottom: 6px;
}

.qr-card-sub {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 400;
  letter-spacing: 0.015em;
  line-height: 1.44;
  color: #5C554E;
  max-width: 310px;
  margin: 0 auto;
  text-wrap: balance;
}

/* Modales Emergentes Profesionales */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 4, 7, 0.88);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.admin-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.admin-modal-content {
  width: min(92%, 600px);
  background: linear-gradient(165deg, #2B1721 0%, #211018 100%);
  border: 1px solid rgba(184, 147, 90, 0.34);
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  color: #FFFFFF;
  transform: translateY(16px) scale(0.95);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal-backdrop.active .admin-modal-content {
  transform: translateY(0) scale(1);
}

.admin-modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(184, 147, 90, 0.22);
  color: var(--text-dim);
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.admin-modal-close:hover {
  color: #FFF;
  background: rgba(184, 147, 90, 0.16);
  border-color: rgba(184, 147, 90, 0.48);
}

/* Modal de Confirmación Elegante del Panel */
.admin-confirm-dialog {
  max-width: 430px;
  text-align: center;
  padding: 30px 28px 28px;
}

.admin-confirm-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--gold-primary);
  font-size: 0.72rem;
}

.admin-confirm-ornament span {
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 147, 90, 0.65), transparent);
}

.admin-confirm-ornament i {
  font-style: normal;
}

.admin-confirm-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: rgba(211, 56, 66, 0.16);
  border: 1px solid rgba(235, 92, 100, 0.45);
  color: #FF8A92;
  box-shadow: 0 0 0 8px rgba(211, 56, 66, 0.08), 0 10px 24px rgba(198, 40, 40, 0.25);
}

.admin-confirm-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 10px;
  line-height: 1.15;
}

.admin-confirm-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin-bottom: 26px;
}

.admin-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-confirm-actions .admin-btn {
  justify-content: center;
  padding: 12px 18px;
}

/* =====================================================================
   NOTIFICACIONES TOAST Y ALERTAS INLINE (DARK VELVET & CHAMPAGNE GOLD)
   ===================================================================== */
.admin-toast-container {
  position: fixed;
  top: 20px;
  right: 22px;
  z-index: 3500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(390px, calc(100vw - 28px));
  pointer-events: none;
}

.admin-toast {
  --atoast-accent: #B8935A;
  --atoast-soft: rgba(184, 147, 90, 0.16);
  --atoast-border: rgba(184, 147, 90, 0.42);
  --atoast-icon: #E2D9CC;
  --atoast-bar: linear-gradient(90deg, #E2D9CC 0%, #B8935A 100%);
  --atoast-duration: 4200ms;

  pointer-events: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 14px 16px 17px 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(44, 23, 33, 0.96) 0%, rgba(28, 14, 21, 0.96) 100%);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--atoast-border);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.52),
    0 0 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: adminToastIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.admin-toast::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 12px;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--atoast-bar);
}

.admin-toast:hover {
  transform: translateY(-2px);
}

.admin-toast.is-leaving {
  pointer-events: none;
  animation: adminToastOut 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.admin-toast.admin-toast-success {
  --atoast-accent: #52B788;
  --atoast-soft: rgba(82, 183, 136, 0.16);
  --atoast-border: rgba(82, 183, 136, 0.42);
  --atoast-icon: #8CE0B6;
  --atoast-bar: linear-gradient(90deg, #74C69D 0%, #40916C 100%);
}

.admin-toast.admin-toast-error {
  --atoast-accent: #E5535B;
  --atoast-soft: rgba(229, 83, 91, 0.18);
  --atoast-border: rgba(229, 83, 91, 0.46);
  --atoast-icon: #FF9BA1;
  --atoast-bar: linear-gradient(90deg, #F07178 0%, #C62828 100%);
}

.admin-toast.admin-toast-warning {
  --atoast-accent: #E6A942;
  --atoast-soft: rgba(230, 169, 66, 0.18);
  --atoast-border: rgba(230, 169, 66, 0.45);
  --atoast-icon: #FFD27D;
  --atoast-bar: linear-gradient(90deg, #F2C063 0%, #C98821 100%);
}

.admin-toast.admin-toast-info {
  --atoast-accent: #B8935A;
  --atoast-soft: rgba(184, 147, 90, 0.16);
  --atoast-border: rgba(184, 147, 90, 0.42);
  --atoast-icon: #E2D9CC;
  --atoast-bar: linear-gradient(90deg, #E2D9CC 0%, #B8935A 100%);
}

.admin-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--atoast-soft);
  border: 1px solid var(--atoast-border);
  color: var(--atoast-icon);
  margin-top: 1px;
}

.admin-toast-icon svg {
  width: 17px;
  height: 17px;
}

.admin-toast-content {
  flex: 1;
  min-width: 0;
}

.admin-toast-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.15;
  margin-bottom: 3px;
}

.admin-toast-msg {
  font-size: 0.81rem;
  line-height: 1.45;
  color: var(--text-dim);
}

.admin-toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: -2px -4px 0 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.admin-toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.admin-toast-progress-bar {
  width: 100%;
  height: 100%;
  background: var(--atoast-bar);
  transform-origin: left center;
  animation: adminToastProgress var(--atoast-duration) linear forwards;
}

.admin-toast:hover .admin-toast-progress-bar,
.admin-toast.is-paused .admin-toast-progress-bar {
  animation-play-state: paused;
}

@keyframes adminToastIn {
  0% {
    opacity: 0;
    transform: translate3d(34px, 0, 0) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes adminToastOut {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(38px, 0, 0) scale(0.95);
  }
}

@keyframes adminToastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Alertas Inline Elegantes (Login y Formularios del Panel) */
.admin-alert {
  --aalert-accent: #B8935A;
  --aalert-bg: rgba(184, 147, 90, 0.12);
  --aalert-border: rgba(184, 147, 90, 0.4);
  --aalert-color: #E2D9CC;

  display: none;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--aalert-bg);
  border: 1px solid var(--aalert-border);
  border-left: 4px solid var(--aalert-accent);
  color: var(--aalert-color);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: left;
  margin-bottom: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.admin-alert.is-visible {
  display: flex;
  animation: adminAlertReveal 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.admin-alert.is-shake {
  animation: adminAlertShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.admin-alert-error {
  --aalert-accent: #E5535B;
  --aalert-bg: linear-gradient(135deg, rgba(198, 40, 40, 0.22) 0%, rgba(130, 22, 32, 0.24) 100%);
  --aalert-border: rgba(229, 83, 91, 0.48);
  --aalert-color: #FFD6D9;
}

.admin-alert-success {
  --aalert-accent: #52B788;
  --aalert-bg: linear-gradient(135deg, rgba(64, 145, 108, 0.22) 0%, rgba(36, 94, 68, 0.22) 100%);
  --aalert-border: rgba(82, 183, 136, 0.45);
  --aalert-color: #D2F4E3;
}

.admin-alert-warning {
  --aalert-accent: #E6A942;
  --aalert-bg: linear-gradient(135deg, rgba(201, 136, 33, 0.22) 0%, rgba(138, 88, 16, 0.22) 100%);
  --aalert-border: rgba(230, 169, 66, 0.46);
  --aalert-color: #FFE9BF;
}

.admin-alert-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--aalert-accent);
  margin-top: 1px;
}

.admin-alert-body {
  flex: 1;
  min-width: 0;
}

@keyframes adminAlertReveal {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes adminAlertShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

@media (max-width: 640px) {
  .admin-toast-container {
    top: 14px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100vw - 24px);
    max-width: 420px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-toast,
  .admin-toast.is-leaving,
  .admin-modal-content,
  .admin-alert {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Estilos de Impresión Limpios */
@media print {
  body {
    background: #FFF !important;
    color: #000 !important;
  }
  .admin-header, .admin-actions-bar, .admin-tabs, .admin-user-menu, .admin-toast-container, .admin-modal-backdrop, .no-print {
    display: none !important;
  }
  .admin-container {
    padding: 0 !important;
  }
  .qr-printable-card {
    box-shadow: none !important;
    border: 1px solid rgba(31, 29, 27, 0.16) !important;
    page-break-inside: avoid;
    margin: 40px auto !important;
  }
}

/* Panel de recuerdos: identidad compartida con el sitio de invitados. */
body.admin-dashboard {
  --admin-bg: #FAF8F5; --admin-surface: #FAF8F5; --admin-surface-light: #F1ECE4;
  --admin-card-border: rgba(184, 147, 90,.26); --gold-primary: #9A7742; --gold-light: #1F1D1B;
  --text-white: #1F1D1B; --text-dim: #6E665E; --text-muted: #6E665E;
  --shadow-dark: 0 18px 48px rgba(31, 29, 27,.14); --shadow-card: 0 6px 22px rgba(31, 29, 27,.055);
  --font-sans: 'Montserrat', 'Plus Jakarta Sans', sans-serif;
  background: var(--admin-bg); color: var(--text-white); font-size: .88rem;
}
.admin-dashboard .ui-icon { width: 1.15em; height: 1.15em; vertical-align: -.15em; }
.admin-dashboard button, .admin-dashboard input, .admin-dashboard select { font: inherit; }
.admin-dashboard :is(button,a,input,select):focus-visible { outline: 1px solid #9A7742; outline-offset: 0px; }
.admin-dashboard button:disabled { opacity: .55; cursor: wait; transform: none; }
.admin-dashboard [hidden] { display: none !important; }
.admin-skip-link { position: fixed; top: -100px; left: 12px; z-index: 3000; padding: 12px 18px; border-radius: 12px; background: #2E2A27; color: #FAF8F5; }
.admin-skip-link:focus { top: 12px; }
.admin-dashboard .admin-header { background: rgba(250, 248, 245,.94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 3px 20px rgba(31, 29, 27,.04); gap: 18px; padding: 14px max(24px,calc((100vw - 1320px)/2)); }
.admin-brand-monogram { width: 54px; height: 54px; object-fit: contain; flex: none; }
.admin-dashboard .admin-brand-title { font-size: 1.7rem; color: #1F1D1B; white-space: nowrap; }
.admin-brand-amp { font-family: 'Tangerine', cursive; font-size: 1.2em; font-weight: 400; }
.admin-dashboard .admin-brand-sub { font-size: .58rem; letter-spacing: .18em; margin-top: 4px; }
.admin-dashboard .admin-user-menu { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.admin-dashboard .user-name-tag { font-size: .72rem; color: var(--text-dim); }
.admin-dashboard .admin-container { max-width: 1368px; padding: 38px 24px 64px; }
.admin-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.admin-eyebrow { color: #9A7742; font-size: .65rem; text-transform: uppercase; letter-spacing: .2em; }
.admin-intro h1 { font-family: var(--font-serif); font-size: clamp(2.2rem,4vw,3.4rem); font-weight: 500; line-height: 1.15; margin: 8px 0; color: #1F1D1B; }
.admin-intro p, .admin-section-note { color: var(--text-dim); font-size: .8rem; line-height: 1.65; }
.admin-dashboard .stats-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 28px; }
.admin-dashboard .stat-card { background: linear-gradient(145deg,#FAF8F5,#FAF8F5); padding: 22px; border-radius:  12px 12px 0px }
.admin-dashboard .stat-card:hover { transform: translateY(-2px); }
.admin-dashboard .stat-label { color: var(--text-dim); font-size: .65rem; line-height: 1.5; letter-spacing: .08em; }
.admin-dashboard .stat-value { font-family: var(--font-serif); color: #2E2A27; font-size: 2.6rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.admin-dashboard .stat-desc { color: var(--text-muted); font-size: .7rem; }
.admin-dashboard .admin-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--admin-card-border); margin-bottom: 26px; overflow-x: auto; }
.admin-dashboard .admin-tab { flex: none; min-height: 48px; padding: 12px 22px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--text-dim); font-weight: 500; white-space: nowrap; }
.admin-dashboard .admin-tab.active { background: transparent; color: #1F1D1B; border-bottom-color: #B8935A; box-shadow: none; }
.admin-dashboard .admin-tab:hover { background: rgba(31, 29, 27,.04); color: #1F1D1B; }
.admin-dashboard .admin-actions-bar { background: transparent; border: 0; padding: 0; box-shadow: none; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-section-title { font-family: var(--font-serif); font-size: 1.9rem; font-weight: 500; color: #1F1D1B; }
.admin-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.admin-dashboard .admin-btn { justify-content: center; min-height: 42px; padding: 10px 16px; font-size: .74rem; font-weight: 500; line-height: 1.4; }
.admin-dashboard .admin-btn-gold { background: #2E2A27; color: #FAF8F5; border: 1px solid #2E2A27; box-shadow: 0 4px 12px rgba(31, 29, 27,.14); }
.admin-dashboard .admin-btn-gold:hover { background: #1F1D1B; box-shadow: 0 6px 18px rgba(31, 29, 27,.18); }
.admin-dashboard .admin-btn:disabled, .admin-dashboard .admin-btn.is-disabled, .admin-dashboard .admin-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.admin-dashboard .admin-btn-gold:disabled:hover, .admin-dashboard .admin-btn-gold.is-disabled:hover, .admin-dashboard .admin-btn-gold[aria-disabled="true"]:hover { background: #2E2A27; box-shadow: none; }
.admin-dashboard .admin-btn-outline { color: #2E2A27; background: transparent; border: 1px solid rgba(31, 29, 27,.25); }
.admin-dashboard .admin-btn-outline:hover { background: rgba(31, 29, 27,.06); border-color: #2E2A27; }
.admin-dashboard .admin-btn-danger { color: #9B3535; background: rgba(155,53,53,.06); border: 1px solid rgba(155,53,53,.23); }
.admin-dashboard .admin-btn-danger:hover { background: rgba(155,53,53,.13); }
.admin-filter-bar { display: grid; grid-template-columns: minmax(220px,1fr) 180px 180px; gap: 12px; padding: 12px; border: 1px solid var(--admin-card-border); border-radius: 22px!important; background: rgba(250, 248, 245,.8); }
.admin-filter-bar label, .admin-search { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.admin-filter-bar label > span, .admin-search > span { font-size: .68rem; color: var(--text-dim); padding-left:8px }
.admin-dashboard :is(input[type="search"],select,.admin-url-input) { width: 100%; min-height: 44px; border: 1px solid rgba(31, 29, 27,.2); border-radius: 10px; padding: 10px 12px; background: #FAF8F5; color: #1F1D1B; min-width: 0; }
.admin-dashboard .admin-url-input[readonly] { background: rgba(31, 29, 27,.06); color: #2E2A27; border-style: dashed; cursor: default; }
.admin-dashboard input::placeholder { color: #71806A; }
.admin-results { margin: 14px 2px; min-height: 20px; color: var(--text-muted); font-size: .73rem; }
.admin-dashboard .media-manager-grid { grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 18px; }
.admin-dashboard .admin-media-card { border-radius: 16px; background: #FAF8F5; }
.admin-dashboard .admin-media-preview { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: #F1ECE4; cursor: pointer; }
.admin-dashboard .admin-media-meta { padding: 16px; }
.admin-dashboard .admin-media-author { font-size: .85rem; color: #1F1D1B; overflow-wrap: anywhere; }
.admin-dashboard .admin-media-sub { font-size: .67rem; color: var(--text-muted); gap: 8px; flex-wrap: wrap; }
.admin-dashboard .admin-media-card-actions { display: flex; gap: 8px; padding-top: 12px; margin-top: 12px; border-top: 1px solid rgba(184, 147, 90,.18); }
.admin-dashboard .admin-media-card-actions > * { flex: 1; }
.admin-load-more { display: flex; justify-content: center; margin-top: 26px; }
.admin-state { grid-column: 1 / -1; width: 100%; padding: 54px 20px; text-align: center; color: var(--text-dim); background: #FAF8F5; border: 1px dashed var(--admin-card-border); border-radius: 16px; }
.admin-state h3 { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 500; }
.admin-state p { margin: 8px 0 16px; font-size: .82rem; }
.admin-loader { display: inline-block; width: 24px; height: 24px; border: 2px solid rgba(31, 29, 27,.18); border-top-color: #2E2A27; border-radius: 50%; animation: adminLoading .8s linear infinite; }
@keyframes adminLoading { to { transform: rotate(360deg); } }
.admin-table-shell { border: 1px solid var(--admin-card-border); border-radius: 18px; background: #FAF8F5; padding: 8px 18px; box-shadow: var(--shadow-card); overflow-x: auto; }
.admin-dashboard .guestbook-table { width: 100%; border-collapse: collapse; }
.admin-dashboard .guestbook-table th { color: var(--text-muted); font-size: .65rem; text-align: left; letter-spacing: .06em; padding: 16px 12px; border-bottom: 1px solid var(--admin-card-border); }
.admin-dashboard .guestbook-table :is(td,th) { padding: 16px 12px; }
.admin-dashboard .guestbook-table td { border-bottom: 1px solid rgba(184, 147, 90,.16); background: transparent; }
.admin-dashboard .guestbook-table tr:hover { background: rgba(31, 29, 27,.025); }
.admin-dashboard .guestbook-msg-preview { color: var(--text-dim); max-width: 480px; }
.admin-dashboard #sectionQR .actions-left { flex-wrap: wrap; max-width: 620px; }
.admin-dashboard .qr-printable-card { background: #FAF8F5; box-shadow: 0 22px 54px rgba(31, 29, 27, 0.14), 0 2px 10px rgba(31, 29, 27, 0.06); max-width: 460px; width: 100%; padding: 40px 40px 30px; color: #1F1D1B; border: 1px solid rgba(31, 29, 27, 0.14); border-radius: 4px; }
.admin-dashboard .qr-card-names { font-family: 'WindSong', cursive; font-style: normal; font-weight: 500; font-size: 2.4rem; line-height: 1.18; color: #1F1D1B; text-align: center; }
.admin-dashboard .qr-card-names .admin-brand-amp { font-family: var(--font-serif); font-size: 0.86em; font-style: italic; font-weight: 400; color: #9A7742; margin: 0 0.08em; }
.admin-dashboard .qr-card-date { font-family: 'Cinzel', var(--font-serif); color: #8A6B3D; letter-spacing: 0.36em; }
.admin-dashboard .qr-card-sub { color: #5C554E; text-wrap: balance; }
.admin-dashboard .qr-card-credit { margin: 22px auto 0; padding-top: 13px; width: 100%; max-width: 230px; border-top: 1px solid rgba(184, 147, 90, 0.28); display: flex; align-items: center; justify-content: center; gap: 6px; }
.admin-dashboard .qr-card-credit-mark { display: block; width: 14px; height: 14px; object-fit: contain; flex-shrink: 0; opacity: 0.92; }
.admin-dashboard .qr-card-credit-sep { display: inline-block; width: 1px; height: 10px; background: rgba(184, 147, 90, 0.45); flex-shrink: 0; }
.admin-dashboard .qr-card-credit-ig { display: block; width: 12px; height: 12px; color: #9A7742; flex-shrink: 0; }
.admin-dashboard .qr-card-credit-handle { font-family: 'Comfortaa', sans-serif; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; color: #6E665E; line-height: 1; }
.admin-dashboard .admin-modal-backdrop { background: rgba(31, 29, 27,.42); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.admin-dashboard .admin-modal-content { max-height: 88dvh; overflow-y: auto; padding: 32px 26px; background: #FAF8F5; color: #1F1D1B; box-shadow: var(--shadow-dark); }
.admin-dashboard .admin-modal-close { color: #2E2A27; background: rgba(31, 29, 27,.05); min-width: 40px; min-height: 40px; top: 12px; right: 12px; }
.admin-dashboard .admin-modal-close:hover { color: #1F1D1B; background: rgba(31, 29, 27,.1); }
.admin-dashboard .admin-confirm-title { color: #1F1D1B; }
.admin-dashboard .admin-confirm-text { color: #6E665E; }
.admin-dashboard #msgModalBody { white-space: pre-wrap; }
.admin-dashboard .admin-toast { background: #FAF8F5; color: #1F1D1B; border-color: rgba(184, 147, 90,.3); box-shadow: var(--shadow-dark); }
.admin-dashboard .admin-toast-title { color: #1F1D1B; }
.admin-dashboard .admin-toast-msg { color: #6E665E; }
.admin-dashboard .admin-toast-close { color: #6E665E; }
body.admin-modal-open { overflow: hidden; }
.admin-dashboard * { scrollbar-width: thin; scrollbar-color: rgba(31, 29, 27,.58) transparent; }
.admin-dashboard ::-webkit-scrollbar { width: 6px; height: 6px; }
.admin-dashboard ::-webkit-scrollbar-thumb { background: rgba(31, 29, 27,.58); border-radius: 999px; }
.admin-dashboard ::-webkit-scrollbar-track { background: rgba(31, 29, 27,.06); }
@media (max-width: 1000px) {
  .admin-dashboard .admin-header { position: relative; align-items: flex-start; padding: 16px 20px; }
  .admin-dashboard .admin-user-menu { max-width: 360px; }
  .admin-dashboard .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-dashboard .stats-grid > .stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .admin-filter-bar { grid-template-columns: 1fr 1fr; }
  .admin-filter-bar .admin-search { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .admin-dashboard .admin-header { flex-direction: column; gap: 16px; padding: 16px; }
  .admin-dashboard .admin-user-menu { width: 100%; max-width: none; justify-content: flex-start; gap: 8px; }
  .admin-dashboard .user-name-tag { flex-basis: 100%; }
  .admin-dashboard .admin-container { padding: 24px 14px 40px; }
  .admin-intro, .admin-section-heading { flex-direction: column; align-items: stretch; gap: 14px; }
  .admin-dashboard .stat-card { padding: 16px 12px; }
  .admin-dashboard .stats-grid { gap: 10px; }
  .admin-dashboard .stat-value { font-size: 2.2rem; }
  .admin-dashboard .stat-label { font-size: .58rem; letter-spacing: .03em; }
  .admin-dashboard .admin-tab { padding: 12px 15px; font-size: .72rem; }
  .admin-filter-bar { padding: 12px; gap: 10px; }
  .admin-dashboard .admin-actions-bar .actions-right, .admin-dashboard .admin-actions-bar .actions-right .admin-btn { width: 100%; }
  .admin-dashboard .media-manager-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .admin-dashboard .admin-media-meta { padding: 10px; }
  .admin-dashboard .admin-media-sub { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
  .admin-dashboard .admin-media-card-actions {  gap: 6px; }
  .admin-dashboard .admin-media-card-actions .admin-btn { font-size: .7rem !important; padding: 8px !important; }
  .admin-table-shell { padding: 0 14px; overflow: visible; }
  .admin-dashboard .guestbook-table thead { display: none; }
  .admin-dashboard .guestbook-table :is(tbody,tr,td) { display: block; width: 100%; }
  .admin-dashboard .guestbook-table tr { padding: 14px 0; border-bottom: 1px solid var(--admin-card-border); }
  .admin-dashboard .guestbook-table td { padding: 7px 0; border: 0; text-align: left !important; }
  .admin-dashboard .guestbook-table td::before { content: attr(data-label); display: block; font-size: .6rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 4px; }
  .admin-dashboard .guestbook-msg-preview { max-width: 100%; }
  .admin-dashboard .admin-modal-content { width: 100%; padding: 22px 18px 22px; }
  .admin-dashboard .qr-printable-card { padding: 24px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .admin-dashboard *, .admin-dashboard *::before, .admin-dashboard *::after { animation: none !important; transition: none !important; }
}
@media print {
  .admin-dashboard .stats-grid, .admin-dashboard .no-print, .admin-skip-link { display: none !important; }
  .admin-dashboard #sectionQR { display: block !important; }
  .admin-dashboard #sectionMedia, .admin-dashboard #sectionGuestbook { display: none !important; }
  .admin-dashboard .qr-printable-card { width: 100%; max-width: 460px; margin: 0 auto !important; }
}

.admin-dashboard .admin-confirm-icon { color: #9B3535; background: rgba(155,53,53,.07); }
.admin-dashboard .admin-toast-icon { color: var(--atoast-accent); }

/* Contenedores uniformes; pastillas y circulos conservan su forma. */
.admin-dashboard { --radius-sm:12px; --radius-md:12px; --radius-lg:12px; }
.admin-dashboard :is(.stat-card,.admin-filter-bar,.admin-media-card,.admin-state,.admin-table-shell,.admin-modal-content,.admin-toast,.admin-alert,input[type="search"],select,.admin-url-input) { border-radius:12px; }
.admin-dashboard .admin-media-card-actions .admin-btn { padding:3px 6px !important; min-height:32px; gap:5px; }
.admin-dashboard :is(.btn-view-gb,.btn-del-gb) { padding:8px !important; width:36px; min-height:36px; justify-content:center; }
.admin-dashboard .stat-link { display:block; text-decoration:none; color:inherit; cursor:pointer; }
.admin-dashboard .stat-link:hover { border-color:#B8935A; }
.admin-custom-select { position:relative; min-width:0; }
.admin-select-trigger { width:100%; min-height:44px; text-align:left; border:1px solid rgba(31, 29, 27,.2); border-radius:12px; padding:10px 12px; background:#FAF8F5; color:#1F1D1B; cursor:pointer; }
.admin-select-options { position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:30; padding:5px; max-height:230px; overflow-y:auto; border:1px solid rgba(184, 147, 90,.3); border-radius:12px; background:#FAF8F5; box-shadow:0 12px 30px rgba(31, 29, 27,.14); }
.admin-select-option { display:block; width:100%; text-align:left; border:0; border-radius:12px; background:transparent; color:#6E665E; padding:10px 12px; min-height:42px; cursor:pointer; }
.admin-select-option:hover, .admin-select-option:focus-visible { background:rgba(31, 29, 27,.07); }
.admin-select-option[aria-selected="true"] { background:rgba(184, 147, 90,.14); color:#1F1D1B; }
html:has(.admin-dashboard) { scrollbar-width:thin; scrollbar-color:rgba(31, 29, 27,.58) rgba(31, 29, 27,.06); }
html:has(.admin-dashboard)::-webkit-scrollbar { width:6px; height:6px; }
html:has(.admin-dashboard)::-webkit-scrollbar-thumb { background:rgba(31, 29, 27,.58); border-radius:999px; }
.admin-dashboard ::-webkit-scrollbar-thumb:hover { background:#9A7742; }

/* Acceso al panel: papel marfil, identidad editorial y formulario claro. */
.admin-login-main { min-height:100vh; min-height:100dvh; display:grid; place-items:center; padding:32px 16px; background:radial-gradient(ellipse at 50% 0,rgba(184, 147, 90,.09),transparent 65%); }
.admin-login-card { width:100%; max-width:400px; padding:32px 34px; text-align:center; border:1px solid rgba(184, 147, 90,.3); border-radius:12px; background:rgba(250, 248, 245,.9); box-shadow:0 18px 52px rgba(31, 29, 27,.09); }
.login-monogram { display:block; width:90px; height:90px; object-fit:contain; margin:0 auto 12px; }
.admin-login-card .admin-brand-title { font-size:2.25rem; }
.login-date { font-size:.65rem; color:#9A7742; letter-spacing:.22em; margin-top:7px; }
.login-divider { height:1px; background:linear-gradient(90deg,transparent,rgba(184, 147, 90,.5),transparent); margin:6px 0; }
.admin-login-card h1 { font-family:var(--font-serif); color:#1F1D1B; font-size:2.1rem; font-weight:500; line-height:1.15; margin:8px 0 0px; }
.login-intro { color:#6E665E; font-size:.8rem; line-height:1.7; margin-bottom:24px; }
.login-field { text-align:left; margin-bottom:7px; }
.login-field label { display:block; color:#2E2A27; font-size:.75rem; margin-bottom:4px; }
.admin-dashboard .login-field input { width:100%; min-height:40px; padding:2px 14px; border:1px solid rgba(31, 29, 27,.25); border-radius:12px; color:#1F1D1B; background:#FAF8F5; font-size:1rem; }
.login-password-wrap { position:relative; }
.admin-dashboard .login-password-wrap input { padding-right:52px; }
.login-password-toggle { position:absolute; right:4px; top:4px; width:32px; height:32px; display:grid; place-items:center; border:0; border-radius:50%; background:transparent; color:#2E2A27; cursor:pointer; }
.login-password-toggle:hover { background:rgba(31, 29, 27,.06); }
.admin-dashboard .login-submit { width:100%; min-height:40px; margin-top:20px; }
.login-back { display:inline-flex; align-items:center; gap:8px; margin-top:0px; color:#6E665E; font-size:.75rem; text-decoration:none; min-height:36px; }
.login-back:hover { color:#9A7742; text-decoration:underline; }
.admin-login-card .admin-alert { text-align:left; color:#8E3030; background:rgba(155,53,53,.06); border-color:rgba(155,53,53,.25); }
@media (max-width:480px) { .admin-login-main { padding:20px 12px; } .admin-login-card { padding:26px 20px; } }

/* Menu del encabezado compacto, desplegado dentro de la propia barra. */
.admin-menu-toggle { display:none; width:44px; height:44px; align-items:center; justify-content:center; border:1px solid rgba(31, 29, 27,.2); border-radius:50%; background:transparent; color:#2E2A27; cursor:pointer; }
.admin-menu-toggle .ui-icon { width:22px; height:22px; }
@media (max-width:1000px) {
  .admin-dashboard .admin-header { display:grid; grid-template-columns:minmax(0,1fr) 44px; align-items:center; gap:0 12px; }
  .admin-menu-toggle { display:inline-flex; }
  .admin-dashboard .admin-header .admin-user-menu { display:grid; grid-column:1 / -1; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; max-width:none; width:100%; max-height:0; padding-top:0; overflow:hidden; visibility:hidden; opacity:0; transition:max-height .3s ease,padding-top .3s ease,opacity .2s ease,visibility .3s; }
  .admin-dashboard .admin-header.is-menu-open .admin-user-menu { max-height:260px; padding-top:18px; visibility:visible; opacity:1; }
  .admin-dashboard .admin-header .user-name-tag { grid-column:1 / -1; padding-bottom:14px; border-bottom:1px solid rgba(184, 147, 90,.3); overflow-wrap:anywhere; }
  .admin-dashboard .admin-header .admin-user-menu > .admin-btn { width:100%; min-width:0; padding:10px 8px; }
}
@media (max-width:380px) { .admin-dashboard .admin-header .admin-brand-title { font-size:1.4rem; } .admin-dashboard .admin-header .admin-brand-sub { font-size:.5rem; letter-spacing:.1em; } .admin-dashboard .admin-header .admin-brand { gap:8px; } .admin-dashboard .admin-header .admin-brand-monogram { width:44px; height:44px; } }
@media (prefers-reduced-motion:reduce) { .admin-dashboard .admin-header .admin-user-menu { transition:none; } }

.admin-select-trigger { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.admin-select-label { min-width:0; }
.admin-select-arrow { display:block; width:18px; height:18px; flex-shrink:0; }

/* Libro de firmas administrativo: columnas adaptables sin desbordar el panel. */
.admin-dashboard .admin-table-shell { width:100%; min-width:0; }
.admin-dashboard .guestbook-table { table-layout:fixed; max-width:100%; }
.admin-dashboard .guestbook-table :is(th,td) { overflow-wrap:anywhere; }
.admin-dashboard .guestbook-table :is(th,td):first-child { width:22%; }
.admin-dashboard .guestbook-table :is(th,td):nth-child(3) { width:18%; }
.admin-dashboard .guestbook-table :is(th,td):last-child { width:124px; }
.admin-dashboard .guestbook-msg-preview { width:100%; max-width:100%; }
@media (max-width:1060px) {
  .admin-dashboard .guestbook-table :is(th,td):nth-child(3) { display:none; }
  .admin-dashboard .guestbook-table :is(th,td):first-child { width:30%; }
}
@media (max-width:910px) {
  .admin-dashboard .guestbook-table :is(th,td):nth-child(2) { display:none; }
  .admin-dashboard .guestbook-table :is(th,td):first-child { width:auto; }
}
/* En movil se conserva la tabla compacta de Invitado y Acciones. */
@media (max-width:640px) {
  .admin-dashboard .admin-table-shell { padding:8px; overflow-x:auto; }
  .admin-dashboard .guestbook-table thead { display:table-header-group; }
  .admin-dashboard .guestbook-table tbody { display:table-row-group; }
  .admin-dashboard .guestbook-table tr { display:table-row; width:auto; padding:0; }
  .admin-dashboard .guestbook-table :is(td,th) { display:table-cell; padding:12px 8px; width:auto; vertical-align:middle; }
  .admin-dashboard .guestbook-table :is(td,th):last-child { width:108px; text-align:right !important; white-space:nowrap; }
  .admin-dashboard .guestbook-table :is(td,th):nth-child(2),
  .admin-dashboard .guestbook-table :is(td,th):nth-child(3) { display:none; }
  .admin-dashboard .guestbook-table td::before { display:none; }
  .admin-dashboard .guestbook-table tbody td[colspan] { display:table-cell; width:auto; white-space:normal; }
}
.admin-dashboard .stat-card.stat-link, .stats-grid .stat-card.storage, .admin-dashboard .admin-toast { border-top-left-radius:0; border-bottom-left-radius:0; }

#qrPrintSheets { display:none; }
.admin-print-label { display:block; margin:20px 0 8px; color:#2E2A27; }
#qrPrintCopies { width:100%; min-height:48px; padding:10px 14px; border:1px solid rgba(31, 29, 27,.25); border-radius:12px; background:#FAF8F5; color:#1F1D1B; }

.admin-dashboard .stat-card { border-top-left-radius:0; border-bottom-left-radius:0; }
.qr-preview-scale { position:relative; width:100%; margin:0 auto; max-width:460px; }
.admin-dashboard .qr-preview-scale > .qr-printable-card { width:460px; max-width:none; padding:40px 40px 30px; transform-origin:top left; }
@media print {
  @page { size:letter landscape; margin:0; }
  html, body.admin-dashboard { margin:0 !important; padding:0 !important; background:white !important; }
  body.admin-dashboard > :not(#qrPrintSheets) { display:none !important; }
  body.admin-dashboard > #qrPrintSheets { display:block !important; }
  .qr-print-sheet { width:279.4mm; height:215.9mm; display:grid; grid-template-columns:repeat(2,139.7mm); align-items:center; justify-items:center; break-after:page; page-break-after:always; overflow:hidden; }
  .qr-print-sheet:last-child { break-after:auto; page-break-after:auto; }
  .qr-print-slot { position:relative; }
  .admin-dashboard .qr-print-sheet .qr-printable-card { position:absolute; top:0; left:0; width:460px !important; max-width:none; height:auto; margin:0 !important; padding:40px 40px 30px; border:1px solid rgba(31, 29, 27, 0.16) !important; border-radius:0; display:flex; flex-direction:column; align-items:center; box-shadow:none; transform-origin:top left; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
}
/* Visor de recuerdos del panel, con acciones y navegación accesibles. */
.admin-dashboard .gallery-lightbox { position:fixed; inset:0; z-index:1900; height:100vh; height:100dvh; display:none; flex-direction:column; background:rgba(8,10,8,.98); color:#FAF8F5; }
.admin-dashboard .gallery-lightbox.active { display:flex; }
.admin-dashboard .lightbox-header, .admin-dashboard .lightbox-bottom { flex-shrink:0; padding:12px 16px; background:rgba(12,15,11,.94); }
.admin-dashboard .lightbox-header { padding-top:calc(12px + env(safe-area-inset-top,0px)); border-bottom:1px solid rgba(255,255,255,.08); }
.admin-dashboard .lightbox-bottom { padding-bottom:calc(14px + env(safe-area-inset-bottom,0px)); border-top:1px solid rgba(255,255,255,.08); }
.admin-dashboard :is(.lightbox-header-inner,.lightbox-bottom-inner) { width:100%; max-width:1000px; margin:auto; }
.admin-dashboard :is(.lightbox-header-inner,.lightbox-user,.lightbox-header-right,.lightbox-actions-row,.lightbox-actions-left,.lightbox-actions-right) { display:flex; align-items:center; gap:8px; }
.admin-dashboard :is(.lightbox-header-inner,.lightbox-actions-row) { justify-content:space-between; }
.admin-dashboard .lightbox-user { min-width:0; }
.admin-dashboard .lightbox-user-info { display:flex; flex-direction:column; min-width:0; }
.admin-dashboard .lightbox-author { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.admin-dashboard :is(.lightbox-time,.lightbox-counter) { font-size:.75rem; color:rgba(255,255,255,.68); }
.admin-dashboard .lightbox-avatar { display:grid; place-items:center; width:40px; height:40px; flex-shrink:0; border-radius:50%; border:1px solid #B8935A; color:#B8935A; }
.admin-dashboard .lightbox-media-container { position:relative; flex:1; min-height:0; display:flex; align-items:center; justify-content:center; padding:12px 56px; }
.admin-dashboard .lightbox-media { display:block; max-width:100%; max-height:100%; object-fit:contain; }
.admin-dashboard :is(.lightbox-close,.lightbox-nav,.lightbox-icon-btn) { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; width:44px; height:44px; border:0; border-radius:50%; background:transparent; color:#FAF8F5; cursor:pointer; text-decoration:none; padding:0; }
.admin-dashboard :is(.lightbox-close,.lightbox-nav,.lightbox-icon-btn):hover { background:rgba(255,255,255,.12); }
.admin-dashboard .lightbox-nav { position:absolute; top:50%; transform:translateY(-50%); background:rgba(255,255,255,.08); }
.admin-dashboard .lightbox-prev { left:6px; }
.admin-dashboard .lightbox-next { right:6px; }
.admin-dashboard .lightbox-nav[hidden] { display:none; }
.admin-dashboard .lightbox-like:disabled { cursor:default; opacity:1; }
.admin-dashboard .lightbox-likes-text { display:flex; gap:5px; font-size:.8rem; }
.admin-dashboard .lightbox-delete { color:#FF7875; }
.admin-dashboard .lightbox-delete:hover { color:#FF4D4F; background:rgba(255,59,48,.16); }
.admin-dashboard .lightbox-delete:disabled { opacity:.5; cursor:wait; }
.admin-dashboard .gallery-lightbox :focus-visible { outline:2px solid #B8935A; outline-offset:3px; }
@media (max-width:480px) { .admin-dashboard .lightbox-media-container { padding:8px 0; } .admin-dashboard .lightbox-nav { background:rgba(8,10,8,.65); z-index:1; } .admin-dashboard .lightbox-likes-text { flex-wrap:wrap; gap:2px; } }
/* Tarjetas de recuerdos: imagen protagonista y acciones sobre el borde inferior. */
.admin-zip-dialog { max-width:540px; }
.admin-zip-dialog .admin-section-title { margin:12px 0; }
.admin-zip-progress-wrap { margin:24px 0; }
.admin-zip-progress-heading { display:flex; justify-content:space-between; gap:12px; margin-bottom:10px; color:#2E2A27; font-size:.85rem; }
#albumZipProgress { display:block; width:100%; height:14px; border:0; border-radius:999px; overflow:hidden; accent-color:#2E2A27; background:#FAF8F5; }
#albumZipProgress::-webkit-progress-bar { background:rgba(31, 29, 27,.12); border-radius:999px; }
#albumZipProgress::-webkit-progress-value { background:#2E2A27; border-radius:999px; }
#albumZipProgress::-moz-progress-bar { background:#2E2A27; border-radius:999px; }
.admin-progress-track { position:relative; width:100%; height:14px; border-radius:999px; overflow:hidden; background:rgba(31, 29, 27,.14); }
.admin-progress-fill { position:relative; width:0%; height:100%; border-radius:999px; background:#2E2A27; transition:width .24s ease-out; overflow:hidden; }
.admin-progress-fill.is-active::after { content:''; position:absolute; inset:0; background:linear-gradient(90deg,transparent,rgba(250, 248, 245,.32),transparent); transform:translateX(-100%); animation:adminProgressSheen 1.4s ease-in-out infinite; }
@keyframes adminProgressSheen { to { transform:translateX(100%); } }
#albumZipStatus,
#deleteProgressStatus { margin-top:12px; min-height:3em; }
.admin-zip-dialog .admin-confirm-actions { flex-wrap:wrap; }
.admin-zip-dialog [hidden] { display:none !important; }
.admin-dashboard .media-manager-grid { display:flex; flex-wrap:wrap; justify-content:center; align-items:stretch; gap:18px; }
.admin-dashboard .media-manager-grid > .admin-state { width:100%; }
.admin-dashboard .admin-media-card { flex:0 0 calc((100% - 72px)/5); width:100%; max-width:250px; height:auto; aspect-ratio:1; min-width:0; box-sizing:border-box; }
.admin-dashboard .admin-media-preview { position:absolute; inset:0; width:100%; height:100%; aspect-ratio:auto; min-height:0; object-fit:cover; object-position:center; }
.admin-dashboard .admin-media-meta { position:absolute; inset:auto 0 0; display:flex; align-items:flex-end; justify-content:space-between; gap:6px; padding:28px 10px 10px; background:linear-gradient(transparent,rgba(8,10,8,.85)); pointer-events:none; }
.admin-dashboard .admin-media-caption { flex:1; min-width:0; align-self:center; }
.admin-dashboard .admin-media-author { color:#FAF8F5; font-size:.72rem; font-weight:500; overflow-wrap:normal; text-shadow:0 1px 3px rgba(0,0,0,.8); }
.admin-dashboard .admin-media-likes { display:block; margin-top:3px; color:#FAF8F5; font-size:.68rem; }
.admin-dashboard .admin-media-card-actions { flex-shrink:0; gap:4px; margin:0; padding:0; border:0; pointer-events:auto; }
.admin-dashboard .admin-media-card-actions > * { flex:0 0 44px; }
.admin-dashboard .admin-media-card-actions .admin-btn { width:30px; height:30px; min-height:30px;max-width: 30px; wpadding:0 !important; border-radius:50%; color:#FAF8F5; border:1px solid rgba(255,255,255,.3); background:rgba(8,10,8,.6); }
.admin-dashboard .admin-media-card-actions .admin-btn-danger { color:#FF7875; }
.admin-dashboard .admin-media-card-actions .admin-btn:hover { background:rgba(8,10,8,.9); }
.admin-dashboard .admin-media-card-actions .admin-btn:focus-visible { outline:2px solid #B8935A; outline-offset:2px; }
.admin-dashboard .admin-media-preview:focus-visible { outline:3px solid #B8935A; outline-offset:-3px; }
@media (max-width:1000px) {
  .admin-dashboard .admin-media-card { flex-basis:calc((100% - 54px)/4); }
}
@media (max-width:800px) {
  .admin-dashboard .admin-media-card { flex-basis:calc((100% - 36px)/3); }
}
@media (max-width:640px) {
  .admin-dashboard .media-manager-grid { gap:10px; }
  .admin-dashboard .admin-media-card { flex-basis:calc((100% - 10px)/2); }
}

/* Selección múltiple en el álbum del panel */
.admin-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--admin-card-border);
  border-radius: 12px;
  background: rgba(250, 248, 245, 0.9);
}
.admin-selection-left,
.admin-selection-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.admin-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #1F1D1B;
  font-size: 0.78rem;
  font-weight: 500;
  user-select: none;
}
.admin-selection-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.admin-dashboard .admin-btn-compact {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 0.72rem;
}
.admin-dashboard .admin-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #2E2A27;
}
.admin-dashboard .admin-card-select-wrap {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(250, 248, 245, 0.88);
  border: 1px solid rgba(31, 29, 27, 0.28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.admin-dashboard .admin-card-select-wrap:hover {
  background: #FAF8F5;
  border-color: #2E2A27;
}
.admin-dashboard .admin-media-card.selected {
  border-color: #2E2A27;
  box-shadow: 0 0 0 3px #2E2A27, var(--shadow-card);
}
.admin-dashboard .admin-media-card.selected .admin-card-select-wrap {
  background: #FAF8F5;
  border-color: #2E2A27;
}
.admin-dashboard .admin-card-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  pointer-events: none;
}
.admin-dashboard .admin-card-type-badge span {
  display: inline-block;
  background: rgba(0, 0, 0, 0.72);
  color: #F5E6C4;
  border: 1px solid rgba(184, 147, 90, 0.45);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.08em;
}
@media (max-width: 640px) {
  .admin-selection-bar {
    padding: 10px 12px;
  }
  .admin-selection-actions {
    width: 100%;
  }
  .admin-selection-actions .admin-btn {
    flex: 1 1 0;
  }
}

/* Barra de acciones del Libro de Firmas (búsqueda + exportar PDF) */
.admin-guestbook-toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-guestbook-toolbar .admin-search {
  min-width: 220px;
}
.admin-guestbook-toolbar #btnExportGuestbookPdf {
  white-space: nowrap;
}
@media (max-width: 720px) {
  .admin-guestbook-toolbar {
    width: 100%;
  }
  .admin-guestbook-toolbar .admin-search {
    flex: 1 1 200px;
  }
  .admin-guestbook-toolbar #btnExportGuestbookPdf {
    width: 100%;
  }
}
