/* =========================================================================
   ESTILOS DEL PANEL DE ADMINISTRACIÓN
   -------------------------------------------------------------------------
   Panel funcional conectado a la base de datos (Supabase). Reproduce el
   estilo del panel original. Tailwind se carga por CDN; aquí van los
   componentes propios.
   ========================================================================= */

body {
  font-family: "Segoe UI", Roboto, system-ui, sans-serif;
  margin: 0;
  color: #333;
}

/* Fondo verde suave del panel */
.admin-bg {
  min-height: 100vh;
  background: linear-gradient(to bottom right, #f0fdf4, #d1fae5, #bbf7d0);
}

/* Barra superior */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
}

/* Menú tipo "píldora" */
.nav-pill {
  display: flex;
  align-items: center;
  border-radius: 2rem;
  background: #fff;
  overflow: hidden;
  width: fit-content;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
.nav-pill .item {
  padding: 0.6rem 1.1rem;
  border-radius: 2rem;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  color: #374151;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.nav-pill .item.active {
  background: #303030;
  color: #fff;
}
.nav-pill .item-exit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #1E7A55;
}
.nav-pill .item-exit:hover {
  background: #E7F3EC;
}
.pill {
  border-radius: 2rem;
  background: #fff;
  padding: 0.6rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

/* Tarjetas / contenedores blancos */
.admin-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  padding: 1.5rem;
}

.muted {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Etiquetas de estado */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.tag-success { background: #dcfce7; color: #166534; }
.tag-danger  { background: #fee2e2; color: #991b1b; }
.tag-warning { background: #fef9c3; color: #854d0e; }
.tag-muted   { background: #e5e7eb; color: #374151; }

/* Formularios */
.field { margin-bottom: 0.25rem; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}
.input,
select.input,
textarea.input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
}
.input:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 0;
}
.input-error { border-color: #ef4444 !important; }
.error-text { color: #ef4444; font-size: 0.8rem; margin-top: 0.2rem; }

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: #10b981; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #059669; }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-text { background: transparent; color: #374151; padding: 0.35rem 0.5rem; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

/* Rejilla de casillas (características) */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.4rem 1rem;
}
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
}

/* Fotos */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.photo-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
}
.photo-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: #f3f4f6;
}
.photo-item .photo-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.5rem;
  gap: 0.3rem;
}

/* Aviso (configuración pendiente, etc.) */
.banner {
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  margin-bottom: 1rem;
}
.banner-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.banner-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Spinner */
.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-bottom-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
