/* Loader visual */
.gestor-loader {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.gestor-loader.active {
  display: flex;
}

.gestor-loader::after {
  content: "";
  width: 20px;
  height: 20px;
  border: 3px solid #008CBD;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Botón deshabilitado visualmente */
.button-disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* Estilos para botones primarios en el Gestor */
.btn-primary {
  display: inline-block;
  background-color: #0286a1;    /* equivalente a bg-blue-600 */
  color: #fff;                  /* texto blanco */
  font-weight: 600;             /* semibold */
  padding: 0.5rem 1rem;         /* py-2 px-4 */
  border-radius: 0.375rem;      /* rounded */
  text-decoration: none;        /* quita subrayado */
  text-align: center;           /* centra el texto */
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: #02748c;    /* equivalente a hover:bg-blue-700 */
}

.btn-primary:visited {
  color: #fff !important;       /* fuerza texto blanco tras visita */
}

.acf-field[data-name="title"] {
  display: none !important;
}

/* ————————————————
   Componentes reutilizables
   ———————————————— */

/* Main wrapper de cada página del Gestor */
.gr-page-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.5rem;      /* igual a p-6 */
  overflow: auto;
  background-color: transparent; /* el gris ya lo da el body */
}

/* Encabezado: título grande */
.gr-page-heading {
  font-size: 1.5rem;    /* ≃ text-2xl */
  font-weight: 600;     /* semibold */
  margin-bottom: 0.5rem;/* ≃ mb-2 */
}

/* Descripción bajo el título */
.gr-page-desc {
  color: #4A5568;       /* text-gray-600 */
  margin-bottom: 1rem;  /* ≃ mb-4 */
}

/* Botón “+ Nuevo” */
.gr-btn-new {
  display: inline-block;
  background-color: #0286a1;    /* tu azul */
  color: #ffffff;
  font-weight: 600;
  padding: 0.5rem 1rem;         /* py-2 px-4 */
  border-radius: 0.375rem;      /* rounded */
  text-decoration: none;
  transition: background-color .2s ease;
}
.gr-btn-new:hover {
  background-color: #02748c;    /* hover */
}

/* Wrapper de la tabla de escritorio */
.gr-table-wrapper {
  overflow-x: auto;
}
@media (max-width: 767px) {
  .gr-table-wrapper {
    display: none;
  }
}

/* La propia tabla */
.gr-table {
  width: 100%;
  background-color: #ffffff;
  border-radius: 0.25rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-size: .875rem; /* text-sm */
  border-collapse: separate;
  border-spacing: 0;
}
.gr-table thead {
  background-color: #ebf8ff; /* bg-blue-100 */
  color: #2d3748;            /* text-gray-800 */
}
.gr-table th,
.gr-table td {
  padding: .5rem .75rem;     /* p-2 */
  text-align: left;
}
.gr-table th.sortable:hover {
  cursor: pointer;
  background-color: #e2e8f0;  /* hover para sortable */
}

/* Vista móvil (cards) */
.gr-table-mobile {
  display: block;
  margin-top: 1rem;           /* mt-4 */
  gap: 1rem;                  
}
@media (min-width: 768px) {
  .gr-table-mobile {
    display: none;
  }
}
.gr-table-mobile > .gr-mobile-card {
  background-color: #ffffff;
  border-radius: 0.25rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  padding: 1rem;
}

/* ———————————————— */
/* Badges de estado */
/* ———————————————— */
.gr-badge-active {
  display: inline-block;
  padding: 0.25rem 0.5rem;      /* py-1 px-2 */
  font-size: 0.75rem;           /* text-xs */
  font-weight: 500;             /* font-medium */
  background-color: #22C55E !important;  /* verde-500 de Tailwind v3 */
  color: #FFFFFF;
  border-radius: 0.25rem;       /* rounded */
}
.gr-badge-inactive {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: #F56565;    /* red-500 */
  color: #FFFFFF;
  border-radius: 0.25rem;
}

/* ———————————————— */
/* Acciones unificadas */
/* ———————————————— */
.gr-actions {
  display: inline-flex;
  align-items: center;
}
.gr-actions a {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;          /* text-sm */
  color: #4A5568;               /* gray-600 */
  text-decoration: none;
  margin-right: 0.75rem;        /* mr-3 */
}
.gr-actions a:last-child {
  margin-right: 0;
}
.gr-actions a:hover {
  color: #2D3748;               /* gray-800 */
}
.gr-actions .emoji {
  margin-right: 0.25rem;        /* mr-1 */
}
.gr-btn-new:hover {
  color: #FFFFFF !important;
}

/* ———————————————————————————— */
/* Forzar fondo y texto de los badges */
/* ———————————————————————————— */
.gr-badge-active {
  background-color: #48BB78 !important;
  color: #FFFFFF !important;
}

.gr-badge-inactive {
  background-color: #F56565 !important;
  color: #FFFFFF !important;
}

/* ———————————————————————————— */
/* Forzar hover del botón +Nuevo */
/* ———————————————————————————— */
.gr-btn-new:hover {
  background-color: #02748c !important;
  color: #FFFFFF !important;
}

/* Corrección para que el CSS funcione correctamente sin errores */

.gr-form-wrapper {
  background-color: #ffffff;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}

.gr-form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #4a5568;
}

.gr-form-input,
.gr-form-textarea,
.gr-form-select {
  margin-top: 0.25rem;
  display: block;
  width: 100%;
  border: 1px solid #cbd5e0;
  border-radius: 0.375rem;
  padding: 0.5rem;
}

.gr-btn-save {
  background-color: #0286a1;
  color: #ffffff;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  border-radius: 0.375rem;
}
.gr-btn-save:hover {
  background-color: #02748c;
}

.gr-btn-cancel {
  background-color: #e2e8f0;
  color: #2d3748;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  border-radius: 0.375rem;
}
.gr-btn-cancel:hover {
  background-color: #cbd5e0;
}

.gr-btn-back {
  background-color: #0286a1;
  color: #ffffff;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
}
.gr-btn-back:hover {
  background-color: #02748c;
}

@media (max-width: 767px) {
  .btn-primary {
    font-size: 0.875rem;
    padding: 0.25rem 1rem;
  }
}

@media (max-width: 767px) {
  main.gr-page-main {
    /* Empujamos 5rem (80px) para cubrir cualquier altura extra del header */
    padding-top: 5rem !important;
    /* Mantener el padding lateral y bottom original */
    padding-right: 1.5rem !important;
    padding-left: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}


